CMXX - Highlights, samples
This commit is contained in:
4
cart.php
4
cart.php
@@ -182,11 +182,11 @@ $view .= '</tbody>
|
|||||||
|
|
||||||
//SUGGESTIONS
|
//SUGGESTIONS
|
||||||
if (!empty($products_in_cart) && !empty(category_id_checkout_suggestions)){
|
if (!empty($products_in_cart) && !empty(category_id_checkout_suggestions)){
|
||||||
$view .= getAccessoiries($pdo,category_id_checkout_suggestions);
|
$view .= getAccessoiries($clientsecret,category_id_checkout_suggestions);
|
||||||
}
|
}
|
||||||
// SAMPLES
|
// SAMPLES
|
||||||
if (!empty($products_in_cart) && !empty(category_id_checkout_samples)){
|
if (!empty($products_in_cart) && !empty(category_id_checkout_samples)){
|
||||||
$view .= getSamples($pdo,category_id_checkout_samples);
|
$view .= getSamples($clientsecret,category_id_checkout_samples);
|
||||||
}
|
}
|
||||||
$view .= '
|
$view .= '
|
||||||
<div class="total">
|
<div class="total">
|
||||||
|
|||||||
@@ -1363,6 +1363,7 @@ footer a:hover {
|
|||||||
padding: 10px;
|
padding: 10px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
mix-blend-mode: multiply;
|
mix-blend-mode: multiply;
|
||||||
|
width: min-content;
|
||||||
}
|
}
|
||||||
|
|
||||||
.add_product a{
|
.add_product a{
|
||||||
@@ -1374,8 +1375,6 @@ footer a:hover {
|
|||||||
color: #555555;
|
color: #555555;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-size: 10px;
|
font-size: 10px;
|
||||||
max-width: 130px;
|
|
||||||
word-wrap: break-word;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.add_price {
|
.add_price {
|
||||||
@@ -1406,4 +1405,54 @@ footer a:hover {
|
|||||||
max-width: 50%;
|
max-width: 50%;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
margin: 40px;
|
margin: 40px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.add_samples{
|
||||||
|
overflow-x: scroll;
|
||||||
|
overflow-y: hidden;
|
||||||
|
white-space: nowrap;
|
||||||
|
width:60%;
|
||||||
|
display: inline-block;
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
|
||||||
|
.add_sample{
|
||||||
|
width:fit-content;
|
||||||
|
display: inline-block;
|
||||||
|
padding: 10px;
|
||||||
|
text-align: center;
|
||||||
|
mix-blend-mode: multiply;
|
||||||
|
}
|
||||||
|
|
||||||
|
.add_sample input[type='submit']{
|
||||||
|
border-radius: 90px;
|
||||||
|
background-color: green;
|
||||||
|
color: #fff;
|
||||||
|
border: none;
|
||||||
|
position: relative;
|
||||||
|
top: -15px;
|
||||||
|
left: 20px;
|
||||||
|
z-index: 999;
|
||||||
|
}
|
||||||
|
|
||||||
|
.add_sample a{
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.add_sample_button{
|
||||||
|
vertical-align: middle;
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.scrollButton{
|
||||||
|
text-decoration: none;
|
||||||
|
background: #2e38462b;
|
||||||
|
border: 0;
|
||||||
|
color: #FFFFFF;
|
||||||
|
padding: 11px 5px;
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: 500;
|
||||||
|
border-radius: 4px;
|
||||||
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
@@ -35,24 +35,17 @@ define('banner_btn_2','Stay@MorvalWatches');
|
|||||||
|
|
||||||
/* Detailed settings */
|
/* Detailed settings */
|
||||||
// Homepage highlightedproducts
|
// Homepage highlightedproducts
|
||||||
define('highlighted_product_range_1','Thomas I');
|
|
||||||
define('category_id_highlighted_products_1','6');
|
define('category_id_highlighted_products_1','6');
|
||||||
// Homepage highlightedproducts
|
// Homepage highlightedproducts
|
||||||
define('highlighted_product_range_2','Thomas II');
|
|
||||||
define('category_id_highlighted_products_2','7');
|
define('category_id_highlighted_products_2','7');
|
||||||
//Homepage show options in carrousel
|
|
||||||
define('show_options_carrousel',false);
|
|
||||||
//Truncate productname on carrousel
|
|
||||||
define('product_truncate_text','Thomas-I');
|
|
||||||
define('product_truncate','1');
|
|
||||||
//Show small images from configuration
|
//Show small images from configuration
|
||||||
define('show_option_images',false);
|
define('show_option_images',false);
|
||||||
// Default category_id for suggestions
|
// Default category_id for suggestions
|
||||||
define('category_id_checkout_suggestions','3');
|
define('category_id_checkout_suggestions','7');
|
||||||
// Default category_id for giftcard
|
// Default category_id for giftcard
|
||||||
define('giftcard_id','');
|
define('giftcard_id','');
|
||||||
// Default category_id for samples
|
// Default category_id for samples
|
||||||
define('category_id_checkout_samples','');
|
define('category_id_checkout_samples','7');
|
||||||
// Default samples
|
// Default samples
|
||||||
define('sample_pricing_override',false);
|
define('sample_pricing_override',false);
|
||||||
// Default samples
|
// Default samples
|
||||||
|
|||||||
@@ -314,39 +314,38 @@ function format_bytes($bytes) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function getAccessoiries($pdo, $categoryID){
|
function getAccessoiries($clientsecret, $categoryID){
|
||||||
|
|
||||||
include './custom/translations/translations_'.strtoupper(language_code).'.php';
|
include './custom/translations/translations_'.strtoupper(language_code).'.php';
|
||||||
|
|
||||||
$stmt = $pdo->prepare('SELECT p.*, (SELECT m.full_path FROM products_media pm JOIN media m ON m.id = pm.media_id WHERE pm.product_id = p.id ORDER BY pm.position ASC LIMIT 1) AS img FROM products p JOIN products_categories pc ON pc.category_id = :category_id AND pc.product_id = p.id JOIN categories c ON c.id = pc.category_id WHERE p.status = 1');
|
//GET CATALOG DATA
|
||||||
$stmt->bindValue(':category_id', $categoryID, PDO::PARAM_INT);
|
$additional_products = ioAPIv2('/v2/catalog/category='.$categoryID,'',$clientsecret);
|
||||||
$stmt->execute();
|
$additional_products = json_decode($additional_products,true);
|
||||||
|
|
||||||
$additional_products = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
|
||||||
$output ='<div class="content-wrapper">
|
$output ='<div class="content-wrapper">
|
||||||
<div class="add_products">
|
<div class="add_products">
|
||||||
<h2>'.$h2_cart_suggestions.'</h2>
|
<h2>'.($h2_cart_suggestions ?? 'Suggestions').'</h2>
|
||||||
';
|
';
|
||||||
|
|
||||||
foreach ($additional_products as $additional_product){
|
foreach ($additional_products as $additional_product){
|
||||||
if (!empty($additional_product['img']) && file_exists($additional_product['img'])){
|
if (!empty($additional_product['full_path'])){
|
||||||
|
|
||||||
$url_contents = 'index.php?page=product&id=';
|
$url_contents = 'index.php?page=product&id=';
|
||||||
$url_contents .= $additional_product['url_slug'] ? $additional_product['url_slug'] : $additional_product['id'];
|
$url_contents .= $additional_product['url_slug'] ? $additional_product['url_slug'] : $additional_product['rowID'];
|
||||||
$additional_product_url = url($url_contents);
|
$additional_product_url = url($url_contents);
|
||||||
$output .='
|
$output .='
|
||||||
<div class="add_product">
|
<div class="add_product">
|
||||||
<a href="'.$additional_product_url.'" id="'.$additional_product['id'].'A" class="product">
|
<a href="'.$additional_product_url.'" id="'.$additional_product['rowID'].'A" class="product">
|
||||||
<img src="'.base_url.$additional_product['img'].'" id="'.$additional_product['id'].'" width="15%" height="" alt="'.$additional_product['name'].'">
|
<img src="'.img_url.$additional_product['full_path'].'" id="'.$additional_product['rowID'].'" width="50" height="50" alt="'.$additional_product['productname'].'">
|
||||||
</a>
|
</a>
|
||||||
<form id="product-form" action="" method="post">
|
<form id="product-form" action="" method="post">
|
||||||
<input type="hidden" name="add_product_id" value="'.$additional_product['id'].'">
|
<input type="hidden" name="add_product_id" value="'.$additional_product['rowID'].'">
|
||||||
<input type="hidden" name="add_product_price" value="'.$additional_product['price'].'">
|
<input type="hidden" name="add_product_price" value="'.$additional_product['price'].'">
|
||||||
<input type="hidden" name="add_product_weight" value="'.$additional_product['weight'].'">
|
<input type="hidden" name="add_product_weight" value="'.($additional_product['weight'] ?? 0).'">
|
||||||
<input type="submit" name="accessoiries" value="+">
|
<input type="submit" name="accessoiries" value="+">
|
||||||
</form>
|
</form>
|
||||||
<a href="'.$additional_product_url.'" id="'.$additional_product['id'].'A" class="product">
|
<a href="'.$additional_product_url.'" id="'.$additional_product['rowID'].'A" class="product">
|
||||||
<span class="add_name">'.$additional_product['name'].'</span>
|
<span class="add_name">'.$additional_product['productname'].'</span>
|
||||||
<span class="add_price"> '.currency_code.'.'.number_format($additional_product['price'],2).'
|
<span class="add_price"> '.currency_code.'.'.number_format($additional_product['price'],2).'
|
||||||
';
|
';
|
||||||
if ($additional_product['rrp'] > 0){
|
if ($additional_product['rrp'] > 0){
|
||||||
@@ -365,24 +364,23 @@ function getAccessoiries($pdo, $categoryID){
|
|||||||
return $output;
|
return $output;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getSamples($pdo, $categoryID){
|
function getSamples($clientsecret, $categoryID){
|
||||||
|
|
||||||
include './custom/translations/translations_'.strtoupper(language_code).'.php';
|
include './custom/translations/translations_'.strtoupper(language_code).'.php';
|
||||||
|
|
||||||
$stmt = $pdo->prepare('SELECT p.*, (SELECT m.full_path FROM products_media pm JOIN media m ON m.id = pm.media_id WHERE pm.product_id = p.id ORDER BY pm.position ASC LIMIT 1) AS img FROM products p JOIN products_categories pc ON pc.category_id = :category_id AND pc.product_id = p.id JOIN categories c ON c.id = pc.category_id WHERE p.status = 1');
|
//GET CATALOG DATA
|
||||||
$stmt->bindValue(':category_id', $categoryID, PDO::PARAM_INT);
|
$additional_products = ioAPIv2('/v2/catalog/category='.$categoryID,'',$clientsecret);
|
||||||
$stmt->execute();
|
$additional_products = json_decode($additional_products,true);
|
||||||
|
|
||||||
$additional_products = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
|
||||||
$output ='<div class="content-wrapper">
|
$output ='<div class="content-wrapper">
|
||||||
<h2 style="font-weight:normal;">'.$h2_cart_samples.'</h2>
|
<h2 style="font-weight:normal;">'.($h2_cart_samples ?? 'Samples').'</h2>
|
||||||
<div class="add_sample_button"><button id="slideLeft" class="scrollButton" type="button"><</button></div>
|
<div class="add_sample_button"><button id="slideLeft" class="scrollButton" type="button"><</button></div>
|
||||||
<div id="add_samples_container" class="add_samples">
|
<div id="add_samples_container" class="add_samples">
|
||||||
|
|
||||||
';
|
';
|
||||||
|
|
||||||
foreach ($additional_products as $additional_product){
|
foreach ($additional_products as $additional_product){
|
||||||
if (!empty($additional_product['img']) && file_exists($additional_product['img'])){
|
if (!empty($additional_product['full_path'])){
|
||||||
|
|
||||||
//Pricing override for samples
|
//Pricing override for samples
|
||||||
if (sample_pricing_override){
|
if (sample_pricing_override){
|
||||||
@@ -390,29 +388,29 @@ function getSamples($pdo, $categoryID){
|
|||||||
}
|
}
|
||||||
|
|
||||||
$url_contents = 'index.php?page=product&id=';
|
$url_contents = 'index.php?page=product&id=';
|
||||||
$url_contents .= $additional_product['url_slug'] ? $additional_product['url_slug'] : $additional_product['id'];
|
$url_contents .= $additional_product['url_slug'] ? $additional_product['url_slug'] : $additional_product['rowID'];
|
||||||
$additional_product_url = url($url_contents);
|
$additional_product_url = url($url_contents);
|
||||||
$output .='
|
$output .='
|
||||||
<div class="add_sample">
|
<div class="add_sample">
|
||||||
<img src="'.base_url.$additional_product['img'].'" id="'.$additional_product['id'].'" width="50" height="50" alt="'.$additional_product['name'].'">
|
<img src="'.img_url.$additional_product['full_path'].'" id="'.$additional_product['rowID'].'" width="50" height="50" alt="'.$additional_product['productname'].'">
|
||||||
<form id="product-form" action="" method="post">
|
<form id="product-form" action="" method="post">
|
||||||
<input type="hidden" name="add_product_id" value="'.$additional_product['id'].'">
|
<input type="hidden" name="add_product_id" value="'.$additional_product['rowID'].'">
|
||||||
<input type="hidden" name="add_product_price" value="'.$additional_product['price'].'">
|
<input type="hidden" name="add_product_price" value="'.$additional_product['price'].'">
|
||||||
<input type="hidden" name="add_product_weight" value="'.$additional_product['weight'].'">
|
<input type="hidden" name="add_product_weight" value="'.($additional_product['weight'] ?? 0).'">
|
||||||
<input type="submit" name="samples" value="+">
|
<input type="submit" name="samples" value="+">
|
||||||
</form>
|
</form>
|
||||||
<a href="'.$additional_product_url.'" id="'.$additional_product['id'].'A" class="product">
|
<a href="'.$additional_product_url.'" id="'.$additional_product['rowID'].'A" class="product">
|
||||||
<span class="add_name">'.$additional_product['name'].'</span>';
|
<span class="add_name">'.$additional_product['productname'].'</span>';
|
||||||
if ($additional_product['price'] > 0){
|
if ($additional_product['price'] > 0){
|
||||||
$output .='
|
$output .='
|
||||||
<span class="add_price"> '.currency_code.'.'.number_format($additional_product['price'],2).'
|
<span class="add_price"> '.currency_code.'.'.number_format($additional_product['price'],2).'
|
||||||
';
|
|
||||||
}
|
|
||||||
if ($additional_product['rrp'] > 0){
|
|
||||||
$output .='
|
|
||||||
<span class="add_rrp">'.currency_code.''.number_format($additional_product['rrp'],2).'</span>
|
|
||||||
';
|
';
|
||||||
}
|
}
|
||||||
|
if ($additional_product['rrp'] > 0){
|
||||||
|
$output .='
|
||||||
|
<span class="add_rrp">'.currency_code.''.number_format($additional_product['rrp'],2).'</span>
|
||||||
|
';
|
||||||
|
}
|
||||||
$output .='
|
$output .='
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user