Merge branch 'development'
#Conflicts: # admin/countries.php # cart.php # custom/css/main.css # custom/customfunctions.php # custom/email/order-details-template.php # custom/email/order-invoice-template.php # custom/email/order-notification-template.php # custom/pages/about.php # custom/pages/about_morval.php # custom/settings/config.php # custom/settings/settings.php # functions.php # home.php # products.php # script.js
This commit is contained in:
28
products.php
28
products.php
@@ -39,6 +39,14 @@ if (isset($_POST['category'])){
|
||||
$products = ioAPIv2('/v2/catalog/'.$url_input,'',$clientsecret);
|
||||
$products = json_decode($products,true);
|
||||
$total_products = count($products);
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
|
||||
//SORT BY NAME
|
||||
usort($products, function($a, $b) {
|
||||
return strcmp($a['productname'], $b['productname']);
|
||||
});
|
||||
>>>>>>> development
|
||||
|
||||
//INCLUDE THE HEADER
|
||||
$view = template_header($products_text,'');
|
||||
@@ -94,6 +102,7 @@ $view .= '</form>
|
||||
<div class="product-grid">';
|
||||
|
||||
foreach ($products as $product){
|
||||
<<<<<<< HEAD
|
||||
|
||||
// Ensure product price is a numeric value
|
||||
$product_price = isset($product['price']) && $product['price'] > 0 ? floatval($product['price']) : 0.00;
|
||||
@@ -102,13 +111,28 @@ $view .= '</form>
|
||||
$view .= '
|
||||
<div class="product-card">
|
||||
<a href="'.url('index.php?page=product&rowID=' . ($product['url_slug'] ? ($product['url_slug'] ) : $product['rowID'])).'" id="'.$product['rowID'].'A" class="product">
|
||||
=======
|
||||
|
||||
// Ensure product price is a numeric value
|
||||
$product_price = isset($product['price']) && $product['price'] > 0 ? floatval($product['price']) : 0.00;
|
||||
|
||||
|
||||
$view .= '
|
||||
<div class="product-card">
|
||||
<a href="'.url('index.php?page=product&rowID=' . ($product['url_slug'] ? ($product['url_slug'] ) : $product['rowID'])).(!empty($product['main_option_for_display']) ? '/'.$product['main_option_for_display']:'').'" id="'.$product['rowID'].'A" class="product">
|
||||
>>>>>>> development
|
||||
<img src="'.img_url.$product['full_path'].'" id="'.$product['rowID'].'" width="" height="250" alt="'.(${$product['productname']} ?? $product['productname']).'">
|
||||
</a>';
|
||||
|
||||
//CHECK IF CONFIGURATION SETTING IS FOUND AND NOT EMPTY => USE GROUP TO DISPLAY IMAGES
|
||||
if (isset($product['configurations']) && isset($product['config_setting']) && $product['config_setting'] != ''){
|
||||
<<<<<<< HEAD
|
||||
|
||||
|
||||
=======
|
||||
|
||||
|
||||
>>>>>>> development
|
||||
//GET THE CONFIG_SETTING GROuP AND DISPLAY
|
||||
foreach ($product['configurations'] as $config){
|
||||
|
||||
@@ -171,7 +195,11 @@ $view .= '</form>
|
||||
|
||||
if (isset($product_price)){
|
||||
|
||||
<<<<<<< HEAD
|
||||
$view .= '<span class="products_price" id="'.$product['rowID'].'C">'.(($product_price != 0.00) ? currency_code.number_format($product_price,2) : '').'';
|
||||
=======
|
||||
$view .= '<span class="products_price" id="'.$product['rowID'].'C">'.(($product_price != 0.00) ? '<span class="price-from">'.$price_from.' </span>'.currency_code.number_format($product_price,2) : '').'';
|
||||
>>>>>>> development
|
||||
|
||||
if (isset($product['rrp']) && $product['rrp'] > 0){
|
||||
$view .= '<span class="products_rrp">'.currency_code.number_format($product['rrp'],2).'</span>';
|
||||
|
||||
Reference in New Issue
Block a user