Refactor partner dropdowns to utilize authorization permissions across various management pages. Enhance invoice creation in webhooks to include account hierarchy. Add marketing system migration script for transitioning files to database structure.
This commit is contained in:
@@ -1,6 +1,10 @@
|
||||
<?php
|
||||
defined($security_key) or exit;
|
||||
|
||||
ini_set('display_errors', '1');
|
||||
ini_set('display_startup_errors', '1');
|
||||
error_reporting(E_ALL);
|
||||
|
||||
//------------------------------------------
|
||||
// Catalog
|
||||
//------------------------------------------
|
||||
@@ -22,7 +26,7 @@ if(isset($get_content) && $get_content!=''){
|
||||
foreach ($requests as $y){
|
||||
$v = explode("=", $y);
|
||||
//INCLUDE VARIABLES IN ARRAY
|
||||
$criterias[$v[0]] = $v[1];
|
||||
$criterias[$v[0]] = $v[1] ?? true;
|
||||
|
||||
if ($v[0] == 'category'){
|
||||
//------------------------------------------
|
||||
@@ -88,7 +92,7 @@ foreach ($products as $product) {
|
||||
$version_configurations[$item['version']] = [
|
||||
'version_id' => $item['version'],
|
||||
'config_setting' => $item['config'],
|
||||
'main_option_for_display' => $item['measurement'],
|
||||
'main_option_for_display' => $item['measurement'] ?? '',
|
||||
'configurations' => []
|
||||
];
|
||||
}
|
||||
@@ -170,6 +174,64 @@ removeKeysRecursive($catalog,$keys_to_remove);
|
||||
//------------------------------------------
|
||||
$messages = processProductCollection($catalog);
|
||||
|
||||
//------------------------------------------
|
||||
//check for METAfeed request
|
||||
//------------------------------------------
|
||||
if (isset($criterias['meta'])){
|
||||
//------------------------------------------
|
||||
// Meta Feed Configuration
|
||||
//------------------------------------------
|
||||
$meta_config = [
|
||||
'base_url' => 'https://www.morvalwatches.com', // Product page URL
|
||||
'image_base_url' => 'https://cloud.soveliti.nl',
|
||||
'brand' => 'Morval Watches',
|
||||
'currency' => 'EUR',
|
||||
'condition' => 'new',
|
||||
'availability' => 'in stock',
|
||||
'google_product_category' => 'Apparel & Accessories > Jewelry > Watches',
|
||||
'output_format' => 'json' // Options: 'csv', 'xml', 'json'
|
||||
];
|
||||
|
||||
//------------------------------------------
|
||||
// Product Code Based Descriptions
|
||||
// Keys can be: exact code (MWTH2NB) or pattern (MWTH1*, MWTH2*)
|
||||
//------------------------------------------
|
||||
$meta_descriptions = [
|
||||
// Pattern based (will match any product starting with this)
|
||||
'MWTH1' => 'The Thomas-I exudes elegance and sophistication. Classic dimensions combined with subtle details in the dial make it an special automatic watch that can be worn on all occasions.',
|
||||
'MWTH2' => 'The Thomas-II provides a view of the beating heart of the Swiss timepiece. It marks the precision and perfection with which the time is displayed.',
|
||||
'MWABR' => 'Handmade Italian calf leather bracelet',
|
||||
];
|
||||
|
||||
//------------------------------------------
|
||||
//Include meta functions
|
||||
//------------------------------------------
|
||||
include_once './assets/functions_meta.php';
|
||||
|
||||
$meta_feed = catalogToMetaFeed($messages, $meta_config);
|
||||
//------------------------------------------
|
||||
// Output based on format parameter
|
||||
//------------------------------------------
|
||||
if ($criterias['meta'] === true) {
|
||||
$format = $meta_config['output_format'];
|
||||
} else {
|
||||
$format = $criterias['meta'];
|
||||
}
|
||||
|
||||
switch ($format) {
|
||||
case 'xml':
|
||||
$messages = outputMetaFeedXML($meta_feed);
|
||||
break;
|
||||
case 'csv':
|
||||
$messages = outputMetaFeedCSV($meta_feed);
|
||||
break;
|
||||
case 'json':
|
||||
default:
|
||||
$messages = outputMetaFeedJSON($meta_feed);
|
||||
break;
|
||||
}
|
||||
exit();
|
||||
}
|
||||
//------------------------------------------
|
||||
//JSON_ENCODE
|
||||
//------------------------------------------
|
||||
|
||||
@@ -102,7 +102,7 @@ if(isset($get_content) && $get_content!=''){
|
||||
//Filter out only relevant servicereports
|
||||
$filter_key_1 = '"%serialnumber%"';
|
||||
$filter_key_2 = '"ServiceReport"';
|
||||
$clause .= ' AND h.type = '.$filter_key_2.' AND NOT e.productrowid = "31" AND h.description like '.$filter_key_1;
|
||||
$clause .= ' AND h.type = '.$filter_key_2.' AND e.productrowid = "31" AND h.description like '.$filter_key_1;
|
||||
//remove from criterias to prevent double binding
|
||||
unset($criterias[$v[0]]);
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ if(isset($get_content) && $get_content!=''){
|
||||
//Define Query
|
||||
if(isset($criterias['totals']) && $criterias['totals'] ==''){
|
||||
//Request for total rows
|
||||
$sql = 'SELECT count(*) as count FROM products_software_licenses '.$whereclause.'';
|
||||
$sql = 'SELECT count(*) as count FROM products_software_licenses l '.$whereclause.'';
|
||||
}
|
||||
elseif (isset($criterias['list']) && $criterias['list'] =='') {
|
||||
//SQL for list
|
||||
|
||||
Reference in New Issue
Block a user