Commit 1bd5c6b8 authored by Ketan's avatar Ketan

size isuue resolve

parent bc208503
...@@ -12,52 +12,45 @@ $tabStyle = $_config->getProductDetail('tab_style'); ...@@ -12,52 +12,45 @@ $tabStyle = $_config->getProductDetail('tab_style');
$objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$registry = $objectManager->get('\Magento\Framework\Registry'); $registry = $objectManager->get('\Magento\Framework\Registry');
$currentProduct = $registry->registry('current_product'); $currentProduct = $registry->registry('current_product');
$product = $objectManager->get('Magento\Catalog\Model\Product')->load($currentProduct->getId()); $product = $objectManager->get('Magento\Catalog\Model\Product')->load($currentProduct->getId());
if(!empty($product->getCustomAttribute('ts_dimensions_length')) && !empty($product->getCustomAttribute('ts_dimensions_length'))){
$length = $product->getCustomAttribute('ts_dimensions_length')->getValue(); $length = $product->getCustomAttribute('ts_dimensions_length')->getValue();
$width = $product->getCustomAttribute('ts_dimensions_width')->getValue(); $width = $product->getCustomAttribute('ts_dimensions_width')->getValue();
$configModel = $objectManager->get('Magento\Variable\Model\Variable')->loadByCode('PRODUCT_SIZE_CONFIG'); $configModel = $objectManager->get('Magento\Variable\Model\Variable')->loadByCode('PRODUCT_SIZE_CONFIG');
$config_value = $configModel->getPlainValue(); $config_value = $configModel->getPlainValue();
if (!empty($width) && !empty($length)) { ?> if (!empty($width) && !empty($length)) { ?>
<script> <script>
require([ require([
'jquery', 'jquery',
], function ($) { ], function ($) {
'use strict'; 'use strict';
if (jQuery('#product_addtocart_form').find('.product-options-wrapper').length) { if (jQuery('#product_addtocart_form').find('.product-options-wrapper').length) {
setTimeout(function(){ setTimeout(function(){
/*var config = { var config = <?php echo $config_value; ?>;
S: 10,
M: 20,
L: 30,
XL: 40,
XXL: 50,
XXXL: 60,
}; */
var config = <?php echo $config_value; ?>;
var baseHeight = <?php echo $length; ?>; var baseHeight = <?php echo $length; ?>;
var baseWidth = <?php echo $width; ?>; var baseWidth = <?php echo $width; ?>;
jQuery('#product_addtocart_form #select_2 option').each(function(){ jQuery('#product_addtocart_form #select_3 option, #product_addtocart_form #select_2 option, #product_addtocart_form #select_4 option').each(function(){
var $this = $(this); var $this = $(this);
var value = $this.text(); var value = $this.text().trim();
var percent = parseInt(config[value]); var percent = parseInt(config[value.split(' ')[0]]);
// console.log("------------------------", `==${value}==`, percent, config, config[value]); console.log("------------------------", `==${value}==`, percent, config, config[value], baseHeight, baseWidth);
if (percent && percent > 0) { if (percent && percent > 0) {
var heigth = parseInt(baseHeight + (baseHeight * percent / 100)); var heigth = parseInt(baseHeight + (baseHeight * percent / 100));
var width = parseInt(baseWidth + (baseWidth * percent / 100)); var width = parseInt(baseWidth + (baseWidth * percent / 100));
$this.text(`${value} (${heigth}x${width} CM)`); $this.text(`${value.split(' ')[0]} (${heigth}x${width} CM)`);
}
});
}, 2000);
} }
}); });
</script> }, 1500);
}
});
</script>
<?php } <?php }
}
$show_custom_tab = $_config->getProductDetail('show_custom_tab'); $show_custom_tab = $_config->getProductDetail('show_custom_tab');
$custom_tab_name = $_config->getProductDetail('custom_tab_name'); $custom_tab_name = $_config->getProductDetail('custom_tab_name');
...@@ -114,20 +107,6 @@ $customtab_content = $_config->getProductDetail('customtab_content'); ...@@ -114,20 +107,6 @@ $customtab_content = $_config->getProductDetail('customtab_content');
<?php } ?> <?php } ?>
</ul> </ul>
<div>
<?php //$block->getProduct()>getResource()->getAttribute('color_picker_swatch')->getFrontend()->getValue($block->getProduct())
//die('sssss');
?>
</div>
<div class="resp-tabs-container"> <div class="resp-tabs-container">
<?php foreach ($detailedInfoGroup as $name): ?> <?php foreach ($detailedInfoGroup as $name): ?>
<?php <?php
......
...@@ -18,6 +18,43 @@ if ($compile_less) { ...@@ -18,6 +18,43 @@ if ($compile_less) {
} }
?> ?>
<style>
.socialIcon{
margin-top: 8px;
}
.socialIcon a{
text-decoration: none;
cursor: pointer;
display: inline-block;
width: 20px;
height: 20px;
text-align: center;
border-radius: 50%;
}
.socialIcon a:nth-child(n+1){
background: #3b5998;
}
.socialIcon a:nth-child(n+2){
background: #fb3958;
}
.socialIcon a:nth-child(n+3){
background: #c4302b;
}
.socialIcon a:nth-child(n+4){
background: #c8232c;
}
.socialIcon i{
color: #fff;
}
.language-wrapper::before{
background: none !important;
}
.language-wrapper .dropdown li a {
padding-left: 2px;
}
</style>
<div class="header-container clearfix"> <div class="header-container clearfix">
<div class="header-top"> <div class="header-top">
<div class="container"> <div class="container">
...@@ -101,4 +138,6 @@ if ($compile_less) { ...@@ -101,4 +138,6 @@ if ($compile_less) {
} }
}); });
</script> </script>
<?php } ?> <?php } ?>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment