CMXX - API based checkout

This commit is contained in:
“VeLiTi”
2025-02-12 11:16:41 +01:00
parent 8201d7804b
commit 2eaf83c3fe
8 changed files with 611 additions and 747 deletions

View File

@@ -140,7 +140,7 @@ $view .= '<div class="products-wrapper">';
$view .= '
<div class="product">
<a href="'.url('index.php?page=product&rowID=' . ($product['url_slug'] ? ($product['url_slug'] ) : $product['rowID'])).'" id="'.$product['rowID'].'A" class="product">
<img src="'.$img_url.$product['full_path'].'" id="'.$product['rowID'].'" width="200" height="" alt="'.$product['productname'].'">
<img src="'.$img_url.$product['full_path'].'" id="'.$product['rowID'].'" width="200" height="" alt="'.(${$product['productname']} ?? $product['productname']).'">
</a>';
//CHECK IF CONFIGURATION SETTING IS FOUND AND NOT EMPTY => USE GROUP TO DISPLAY IMAGES
@@ -157,15 +157,13 @@ $view .= '<div class="products-wrapper">';
//GET ALL RELATED ATTRIBUTES
foreach ($config['attributes'] as $attribute){
$option_id = $attribute['alternative_media']; // ID of the LARGE IMAGE
$option_id = $attribute['attribute_id']; // ID of the LARGE IMAGE
$IMG_small_id = $img_url.$attribute['full_path']; //URL TO SMALL IMAGE
$IMG_large_id = $img_url.$attribute['alternative_media_full_path']; //URL TO LARGE IMAGE
// Ensure attribute price is a numeric value
$attribute_price = isset($attribute['price']) ? floatval($attribute['price']) : 0.00;
//$option_price = (isset($attribute['price'])) ? (currency_code.((isset($attribute['price_modifier']) && $attribute['price_modifier'] == 1) ? number_format(floatval($product_price+$attribute_price),2) : number_format(($product_price-$attribute_price),2))) : (($product_price != 0.00) ? currency_code.number_format($product_price,2) : '');
$option_price = isset($attribute['price'])
// If price modifier is 1, add prices; otherwise, subtract
? ((isset($attribute['price_modifier']) && $attribute['price_modifier'] == 1) ? currency_code . number_format(floatval($product_price + $attribute_price), 2) : currency_code . number_format(floatval($product_price - $attribute_price), 2))
@@ -207,7 +205,7 @@ $view .= '<div class="products-wrapper">';
}
$option_id ='';
$view .='<a href="'.url('index.php?page=product&rowID=' . ($product['url_slug'] ? $product['url_slug'].$option_id : $product['rowID'])).'" id="'.$product['rowID'].'B" class="product">
<span class="name">'.$product['productname'].'</span>';
<span class="name">'.(${$product['productname']} ?? $product['productname']).'</span>';
if (isset($product_price)){