Commit b2c06cb4 by liumengfei

Merge branch 'developer' into production

parents a28ae9b2 1fc76e1e
<?php
/**
* Web Technology Codes
* Web Technology Codes Google Language Translator Extension
*
* @category WebTechnologyCodes
* @package WebTechnlogyCodes_GoogleLanguageTranslater
* @copyright Copyright © 2018 Web Technology Codes (https://www.webtechnologycodes.com)
* @license https://www.webtechnologycodes.com/magento-extension-license/
*/
namespace Joshine\FreeBar\Block;
use Magento\Framework\View\Element\Template;
class Index extends Template
{
/**
* Initialize
*
* @param \Magento\Framework\View\Element\Template\Context $context
* @param array $data
*/
public function __construct(
\Magento\Framework\View\Element\Template\Context $context,
array $data = []
) {
parent::__construct($context, $data);
}
/**
* Get System configuration option values
*/
public function getConfigValue($value = '') {
return $this->_scopeConfig
->getValue(
$value,
\Magento\Store\Model\ScopeInterface::SCOPE_STORE
);
}
/**
* Return image url
*
* @return string
*/
public function getImageValue($mobile = '')
{
if ($mobile){
$drive_type ="freebar/general/image_mobile";
}else{
$drive_type ="freebar/general/image_pc";
}
$image_url = $this->_scopeConfig->getValue($drive_type,\Magento\Store\Model\ScopeInterface::SCOPE_STORE);
return $this->getMediaUrl(). 'joshine/freebar/'.$image_url;
}
/**
* Return media path
*
* @return string
*/
public function getMediaUrl()
{
return $this->_storeManager->getStore()
->getBaseUrl(\Magento\Framework\UrlInterface::URL_TYPE_MEDIA);
}
}
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd">
<acl>
<resources>
<resource id="Magento_Backend::admin">
<resource id="Magento_Backend::stores">
<resource id="Magento_Backend::stores_settings">
<resource id="Magento_Config::config">
<resource id="Joshine_FreeBar::config_system" title="Free Bar" sortOrder="1" />
</resource>
</resource>
</resource>
</resource>
</resources>
</acl>
</config>
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
<system>
<section id="freebar" translate="label" type="text" sortOrder="320" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Freebar</label>
<tab>joshine</tab>
<resource>Joshine_FreeBar::config_system</resource>
<group id="general" translate="label" type="select" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
<label><![CDATA[Top free bars]]></label>
<field id="active" translate="label" type="select" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
<label><![CDATA[是否打开]]></label>
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
</field>
<field id="is_pic" translate="label" type="select" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
<label><![CDATA[是否图片]]></label>
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
</field>
<field id="content" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
<label><![CDATA[文案内容]]></label>
<depends>
<field id="is_pic">0</field>
</depends>
</field>
<field id="content_size" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
<label><![CDATA[字体大小]]></label>
<comment><![CDATA[默认为14px]]></comment>
<depends>
<field id="is_pic">0</field>
</depends>
</field>
<field id="content_color" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
<label><![CDATA[文字颜色]]></label>
<comment><![CDATA[默认为#000]]></comment>
<depends>
<field id="is_pic">0</field>
</depends>
</field>
<field id="content_back_color" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
<label><![CDATA[背景颜色]]></label>
<comment><![CDATA[默认为#FFF]]></comment>
<depends>
<field id="is_pic">0</field>
</depends>
</field>
<field id="image_pc" translate="label" type="Magento\Config\Block\System\Config\Form\Field\Image" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1" >
<label>PC Image</label>
<backend_model>Magento\Config\Model\Config\Backend\Image</backend_model>
<upload_dir config="system" scope_info="1">joshine/freebar</upload_dir>
<base_url type="media" scope_info="1">joshine/freebar</base_url>
<depends>
<field id="is_pic">1</field>
</depends>
</field>
<field id="image_mobile" translate="label" type="Magento\Config\Block\System\Config\Form\Field\Image" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1" >
<label>Mobile Image</label>
<backend_model>Magento\Config\Model\Config\Backend\Image</backend_model>
<upload_dir config="system" scope_info="1">joshine/freebar</upload_dir>
<base_url type="media" scope_info="1">joshine/freebar</base_url>
<depends>
<field id="is_pic">1</field>
</depends>
</field>
</group>
</section>
</system>
</config>
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Store/etc/config.xsd">
<default>
<freebar_settings>
<general>
<active>1</active>
<content_size>14px</content_size>
<content_color>#FFF</content_color>
<content_back_color>#000</content_back_color>
</general>
</freebar_settings>
</default>
</config>
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Joshine_FreeBar" setup_version="1.0.0" />
</config>
<?php
\Magento\Framework\Component\ComponentRegistrar::register(
\Magento\Framework\Component\ComponentRegistrar::MODULE,
'Joshine_FreeBar',
__DIR__
);
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceContainer name="page.wrapper">
<block class="Joshine\FreeBar\Block\Index" name="free-shipping.bar" template="Joshine_FreeBar::free_shipping_bar.phtml" before="-" >
<arguments>
<argument name="cache_lifetime" xsi:type="number">3600</argument>
</arguments>
</block>
</referenceContainer>
</body>
</page>
<?php
/** @var $block \Joshine\FreeBar\Block\Index */
?>
<?php
$isEnable = $block->getConfigValue('freebar/general/active');
if ($isEnable):
$is_image = $block->getConfigValue('freebar/general/is_pic');
if ($is_image):
?>
<style>
.free-shipping-bar{width: 100%; height: auto;z-index: 10;}
@media (max-width: 768px) {.free-shipping-bar{position: fixed;}}
</style>
<div class="free-shipping-bar">
<picture>
<source media="(max-width: 768px)" srcset="<?=$block->getImageValue(1)?>">
<source media="(min-width: 769px)" srcset="<?=$block->getImageValue()?>">
<img src="<?=$block->getImageValue()?>" loading="lazy" >
</picture>
</div>
<?php else: ?>
<style>
.free-shipping-bar{
width: 100%;
height: 40px;
line-height: 40px;
text-align: center;
background-size: 100% 100%!important;
background-repeat: no-repeat;
background-color: <?=$block->getConfigValue('freebar/general/content_back_color') ?>;
font-size: <?=$block->getConfigValue('freebar/general/content_size') ?>;
z-index: 10;
}
@media (max-width: 768px) {.free-shipping-bar{position: fixed;}}
.free-shipping-bar span {width: 100%;height: 100%; display: block; color: <?=$block->getConfigValue('freebar/general/content_color') ?>}
</style>
<div class="free-shipping-bar">
<span><?=$block->getConfigValue('freebar/general/content') ?></p></span>
</div>
<?php endif ?>
<?php endif ?>
...@@ -133,7 +133,7 @@ class Upsell extends AbstractProduct implements IdentityInterface ...@@ -133,7 +133,7 @@ class Upsell extends AbstractProduct implements IdentityInterface
$collection->addAttributeToSelect('*'); $collection->addAttributeToSelect('*');
$collection->setVisibility($this->_catalogProductVisibility->getVisibleInCatalogIds()); $collection->setVisibility($this->_catalogProductVisibility->getVisibleInCatalogIds());
$collection->getSelect()->order('rand()'); $collection->getSelect()->order('rand()');
$collection->setPageSize(10); $collection->setPageSize(6);
$collection->addStoreFilter($product->getStoreId()); $collection->addStoreFilter($product->getStoreId());
$this->_itemCollection = $collection; $this->_itemCollection = $collection;
......
...@@ -34,7 +34,7 @@ class Recently extends \Magento\Framework\App\Action\Action ...@@ -34,7 +34,7 @@ class Recently extends \Magento\Framework\App\Action\Action
$productCollection->addAttributeToSelect('*') $productCollection->addAttributeToSelect('*')
->addFieldToFilter('status', 1) ->addFieldToFilter('status', 1)
->addAttributeToFilter('entity_id', array( 'in' => $in)); ->addAttributeToFilter('entity_id', array( 'in' => $in));
$productCollection->getSelect()->order(sprintf("field(e.entity_id,%s)", $productIds)); $productCollection->getSelect()->order(sprintf("field(e.entity_id,%s)", $productIds))->limit(6);
/** @var \Magento\CatalogInventory\Helper\Stock $stockHelper */ /** @var \Magento\CatalogInventory\Helper\Stock $stockHelper */
$stockHelper = $this->_objectManager->get('Magento\CatalogInventory\Helper\Stock'); $stockHelper = $this->_objectManager->get('Magento\CatalogInventory\Helper\Stock');
$stockHelper->addInStockFilterToCollection($productCollection); $stockHelper->addInStockFilterToCollection($productCollection);
......
...@@ -73,6 +73,7 @@ class Onepage extends \Magento\Framework\View\Element\Template ...@@ -73,6 +73,7 @@ class Onepage extends \Magento\Framework\View\Element\Template
$this->serializer = $serializerInterface ?: \Magento\Framework\App\ObjectManager::getInstance() $this->serializer = $serializerInterface ?: \Magento\Framework\App\ObjectManager::getInstance()
->get(\Magento\Framework\Serialize\Serializer\JsonHexTag::class); ->get(\Magento\Framework\Serialize\Serializer\JsonHexTag::class);
$this->_scopeConfigInterface = $_scopeConfigInterface; $this->_scopeConfigInterface = $_scopeConfigInterface;
$this->_urlBuilder = $context->getUrlBuilder();
} }
/** /**
...@@ -116,7 +117,13 @@ class Onepage extends \Magento\Framework\View\Element\Template ...@@ -116,7 +117,13 @@ class Onepage extends \Magento\Framework\View\Element\Template
$price = $_helper->currency($full_free, true, false); $price = $_helper->currency($full_free, true, false);
return $price; return $price;
} }
public function getLogoUrl()
{
$path = $this->_scopeConfigInterface->getValue('design/header/logo_src','stores',1);
$logoUrl = $this->_urlBuilder
->getBaseUrl(['_type' => \Magento\Framework\UrlInterface::URL_TYPE_MEDIA]) .'logo/'. $path;
return $logoUrl;
}
public function getFullFreeShip() public function getFullFreeShip()
{ {
return $this->_scopeConfigInterface->getValue('carriers/freeshipping/free_shipping_subtotal'); return $this->_scopeConfigInterface->getValue('carriers/freeshipping/free_shipping_subtotal');
......
...@@ -90,21 +90,21 @@ class DefaultItem extends AbstractItem ...@@ -90,21 +90,21 @@ class DefaultItem extends AbstractItem
$resource = $objectManager->get('Magento\Framework\App\ResourceConnection'); $resource = $objectManager->get('Magento\Framework\App\ResourceConnection');
$connection = $resource->getConnection(); $connection = $resource->getConnection();
if (!empty($options)) { // if (!empty($options)) {
foreach ($options as $key => $option) { // foreach ($options as $key => $option) {
if ($option['label'] != 'Size') { // if ($option['label'] != 'Size') {
$tableName = $resource->getTableName('eav_attribute_option_value'); // $tableName = $resource->getTableName('eav_attribute_option_value');
$sql = "Select * FROM " . $tableName ." where store_id=0 AND option_id=".$option['option_value']; // $sql = "Select * FROM " . $tableName ." where store_id=0 AND option_id=".$option['option_value'];
$result = $connection->fetchRow($sql); // $result = $connection->fetchRow($sql);
$options[$key]['value'] = $result['value']; // $options[$key]['value'] = $result['value'];
} else { // } else {
$tableName = $resource->getTableName('eav_attribute_option_swatch'); // $tableName = $resource->getTableName('eav_attribute_option_swatch');
$sql = "Select * FROM " . $tableName ." where store_id=0 AND option_id=".$option['option_value']; // $sql = "Select * FROM " . $tableName ." where store_id=0 AND option_id=".$option['option_value'];
$result = $connection->fetchRow($sql); // $result = $connection->fetchRow($sql);
$options[$key]['value'] = $result['value']; // $options[$key]['value'] = $result['value'];
} // }
} // }
} // }
return [ return [
'options' => $options, 'options' => $options,
'qty' => $this->item->getQty() * 1, 'qty' => $this->item->getQty() * 1,
......
...@@ -35,18 +35,42 @@ ...@@ -35,18 +35,42 @@
<item name="component" xsi:type="string">Magento_Ui/js/view/messages</item> <item name="component" xsi:type="string">Magento_Ui/js/view/messages</item>
<item name="displayArea" xsi:type="string">messages</item> <item name="displayArea" xsi:type="string">messages</item>
</item> </item>
<item name="authentication" xsi:type="array"> <item name="customer-email" xsi:type="array">
<item name="component" xsi:type="string">Magento_Checkout/js/view/authentication</item> <item name="component" xsi:type="string">Magento_Checkout/js/view/form/element/email</item>
<item name="displayArea" xsi:type="string">authentication</item> <item name="displayArea" xsi:type="string">customer-email</item>
<item name="tooltip" xsi:type="array">
<item name="description" xsi:type="string" translate="true">We'll send your order confirmation here.</item>
</item>
<item name="children" xsi:type="array"> <item name="children" xsi:type="array">
<!--Additional authentication fields--> <item name="before-login-form" xsi:type="array">
<item name="errors" xsi:type="array"> <item name="component" xsi:type="string">uiComponent</item>
<item name="sortOrder" xsi:type="string">0</item> <item name="displayArea" xsi:type="string">before-login-form</item>
<item name="component" xsi:type="string">Magento_Checkout/js/view/authentication-messages</item> <item name="children" xsi:type="array">
<item name="displayArea" xsi:type="string">messages</item> <!-- before login form fields -->
</item>
</item>
<item name="additional-login-form-fields" xsi:type="array">
<item name="component" xsi:type="string">uiComponent</item>
<item name="displayArea" xsi:type="string">additional-login-form-fields</item>
<item name="children" xsi:type="array">
<!-- additional login form fields -->
</item>
</item>
<item name="authentication" xsi:type="array">
<item name="component" xsi:type="string">Magento_Checkout/js/view/authentication</item>
<item name="displayArea" xsi:type="string">authentication</item>
<item name="children" xsi:type="array">
<!--Additional authentication fields-->
<item name="errors" xsi:type="array">
<item name="sortOrder" xsi:type="string">0</item>
<item name="component" xsi:type="string">Magento_Checkout/js/view/authentication-messages</item>
<item name="displayArea" xsi:type="string">messages</item>
</item>
</item>
</item> </item>
</item> </item>
</item> </item>
<!-- <!--
<item name="progressBar" xsi:type="array"> <item name="progressBar" xsi:type="array">
<item name="component" xsi:type="string">Magento_Checkout/js/view/progress-bar</item> <item name="component" xsi:type="string">Magento_Checkout/js/view/progress-bar</item>
...@@ -70,29 +94,6 @@ ...@@ -70,29 +94,6 @@
</item> </item>
</item> </item>
--> -->
<item name="cart_items" xsi:type="array">
<item name="component" xsi:type="string">Magento_Checkout/js/view/summary/cart-items</item>
<item name="displayArea" xsi:type="string">estimation</item>
<item name="children" xsi:type="array">
<item name="details" xsi:type="array">
<item name="component" xsi:type="string">Magento_Checkout/js/view/summary/item/details</item>
<item name="children" xsi:type="array">
<item name="thumbnail" xsi:type="array">
<item name="component" xsi:type="string">Magento_Checkout/js/view/summary/item/details/thumbnail</item>
<item name="displayArea" xsi:type="string">before_details</item>
</item>
<item name="subtotal" xsi:type="array">
<item name="component" xsi:type="string">Magento_Checkout/js/view/summary/item/details/subtotal</item>
<item name="displayArea" xsi:type="string">after_details</item>
</item>
<item name="message" xsi:type="array">
<item name="component" xsi:type="string">Magento_Checkout/js/view/summary/item/details/message</item>
<item name="displayArea" xsi:type="string">item_message</item>
</item>
</item>
</item>
</item>
</item>
<item name="steps" xsi:type="array"> <item name="steps" xsi:type="array">
<item name="component" xsi:type="string">uiComponent</item> <item name="component" xsi:type="string">uiComponent</item>
<item name="displayArea" xsi:type="string">steps</item> <item name="displayArea" xsi:type="string">steps</item>
...@@ -142,29 +143,7 @@ ...@@ -142,29 +143,7 @@
<item name="provider" xsi:type="string">checkoutProvider</item> <item name="provider" xsi:type="string">checkoutProvider</item>
<item name="sortOrder" xsi:type="string">10</item> <item name="sortOrder" xsi:type="string">10</item>
<item name="children" xsi:type="array"> <item name="children" xsi:type="array">
<item name="customer-email" xsi:type="array">
<item name="component" xsi:type="string">Magento_Checkout/js/view/form/element/email</item>
<item name="displayArea" xsi:type="string">customer-email</item>
<item name="tooltip" xsi:type="array">
<item name="description" xsi:type="string" translate="true">We'll send your order confirmation here.</item>
</item>
<item name="children" xsi:type="array">
<item name="before-login-form" xsi:type="array">
<item name="component" xsi:type="string">uiComponent</item>
<item name="displayArea" xsi:type="string">before-login-form</item>
<item name="children" xsi:type="array">
<!-- before login form fields -->
</item>
</item>
<item name="additional-login-form-fields" xsi:type="array">
<item name="component" xsi:type="string">uiComponent</item>
<item name="displayArea" xsi:type="string">additional-login-form-fields</item>
<item name="children" xsi:type="array">
<!-- additional login form fields -->
</item>
</item>
</item>
</item>
<item name="before-form" xsi:type="array"> <item name="before-form" xsi:type="array">
<item name="component" xsi:type="string">uiComponent</item> <item name="component" xsi:type="string">uiComponent</item>
<item name="displayArea" xsi:type="string">before-form</item> <item name="displayArea" xsi:type="string">before-form</item>
...@@ -379,6 +358,29 @@ ...@@ -379,6 +358,29 @@
</item> </item>
</item> </item>
<item name="children" xsi:type="array"> <item name="children" xsi:type="array">
<item name="cart_items" xsi:type="array">
<item name="component" xsi:type="string">Magento_Checkout/js/view/summary/cart-items</item>
<item name="displayArea" xsi:type="string">estimation</item>
<item name="children" xsi:type="array">
<item name="details" xsi:type="array">
<item name="component" xsi:type="string">Magento_Checkout/js/view/summary/item/details</item>
<item name="children" xsi:type="array">
<item name="thumbnail" xsi:type="array">
<item name="component" xsi:type="string">Magento_Checkout/js/view/summary/item/details/thumbnail</item>
<item name="displayArea" xsi:type="string">before_details</item>
</item>
<item name="subtotal" xsi:type="array">
<item name="component" xsi:type="string">Magento_Checkout/js/view/summary/item/details/subtotal</item>
<item name="displayArea" xsi:type="string">after_details</item>
</item>
<item name="message" xsi:type="array">
<item name="component" xsi:type="string">Magento_Checkout/js/view/summary/item/details/message</item>
<item name="displayArea" xsi:type="string">item_message</item>
</item>
</item>
</item>
</item>
</item>
<item name="summary" xsi:type="array"> <item name="summary" xsi:type="array">
<item name="component" xsi:type="string">Magento_Checkout/js/view/summary</item> <item name="component" xsi:type="string">Magento_Checkout/js/view/summary</item>
<item name="displayArea" xsi:type="string">summary</item> <item name="displayArea" xsi:type="string">summary</item>
......
...@@ -12,28 +12,8 @@ ...@@ -12,28 +12,8 @@
<body> <body>
<referenceContainer name="page.bottom.container" remove="true"/> <referenceContainer name="page.bottom.container" remove="true"/>
<referenceContainer name="footer-container" remove="true"/> <referenceContainer name="footer-container" remove="true"/>
<referenceBlock name="catalog.topnav" remove="true" />
<referenceBlock name="top.search" remove="true" /> <referenceBlock name="top.search" remove="true" />
<referenceBlock name="sparsh.free-shipping.bar.top" remove="true" /> <referenceBlock name="sparsh.free-shipping.bar.top" remove="true" />
<referenceBlock name="header.search.bar" remove="true" />
<referenceBlock name="header.account" remove="true" />
<referenceBlock name="header.wishlist" remove="true" />
<referenceBlock name="minicart" remove="true" />
<referenceContainer name="header.container">
<block class="Magento\Cms\Block\Block" name="cart.payment.top">
<arguments>
<argument name="block_id" xsi:type="string">cart_payment_top</argument>
</arguments>
</block>
</referenceContainer>
<referenceContainer name="columns.top">
<block class="Magento\Cms\Block\Block" name="progress.bar" before="-">
<arguments>
<argument name="block_id" xsi:type="string">progress_bar</argument>
</arguments>
</block>
</referenceContainer>
<referenceBlock name="page.main.title"> <referenceBlock name="page.main.title">
<block class="Magento\Checkout\Block\Onepage\Success" name="checkout.success.print.button" template="Magento_Checkout::button.phtml"/> <block class="Magento\Checkout\Block\Onepage\Success" name="checkout.success.print.button" template="Magento_Checkout::button.phtml"/>
<action method="setPageTitle"> <action method="setPageTitle">
......
...@@ -9,13 +9,6 @@ ...@@ -9,13 +9,6 @@
?> ?>
<div id="checkout" data-bind="scope:'checkout'" class="checkout-container"> <div id="checkout" data-bind="scope:'checkout'" class="checkout-container">
<div id="checkout-loader" data-role="checkout-loader" class="loading-mask" data-mage-init='{"checkoutLoader": {}}'>
<div class="loader">
<img src="<?= $block->escapeUrl($block->getViewFileUrl('images/loader-1.gif')) ?>"
alt="<?= $block->escapeHtmlAttr(__('Loading...')) ?>">
</div>
</div>
<?= /* @noEscape */ $secureRenderer->renderStyleAsTag("position: absolute;", "#checkout-loader img") ?>
<!-- ko template: getTemplate() --><!-- /ko --> <!-- ko template: getTemplate() --><!-- /ko -->
<script type="text/x-magento-init"> <script type="text/x-magento-init">
{ {
...@@ -35,10 +28,8 @@ script; ...@@ -35,10 +28,8 @@ script;
<?= /* @noEscape */ $secureRenderer->renderTag('script', [], $scriptString, false) ?> <?= /* @noEscape */ $secureRenderer->renderTag('script', [], $scriptString, false) ?>
<?php $scriptString = <<<script <?php $scriptString = <<<script
require([ require([
'mage/url', 'mage/url'
'Magento_Ui/js/block-loader' ], function(url) {
], function(url, blockLoader) {
blockLoader("{$block->escapeJs($block->escapeUrl($block->getViewFileUrl('images/loader-1.gif')))}");
return url.setBaseUrl('{$block->escapeJs($block->escapeUrl($block->getBaseUrl()))}'); return url.setBaseUrl('{$block->escapeJs($block->escapeUrl($block->getBaseUrl()))}');
}) })
script; script;
......
...@@ -42,6 +42,7 @@ define([ ...@@ -42,6 +42,7 @@ define([
totals = ko.observable(totalsData), totals = ko.observable(totalsData),
collectedTotals = ko.observable({}); collectedTotals = ko.observable({});
return { return {
totals: totals, totals: totals,
shippingAddress: shippingAddress, shippingAddress: shippingAddress,
...@@ -53,7 +54,6 @@ define([ ...@@ -53,7 +54,6 @@ define([
paymentMethod: paymentMethod, paymentMethod: paymentMethod,
paymentMethodlist:paymentMethodlist, paymentMethodlist:paymentMethodlist,
guestEmail: null, guestEmail: null,
/** /**
* @return {*} * @return {*}
*/ */
...@@ -119,12 +119,6 @@ define([ ...@@ -119,12 +119,6 @@ define([
getPaymentMethod: function () { getPaymentMethod: function () {
return paymentMethod; return paymentMethod;
}, },
setShippingSaveMethod: function (Method) {
shippingSaveMethod(Method);
},
getShippingSaveMethod: function () {
return shippingSaveMethod;
},
setPaymentMethodList: function (MethodList) { setPaymentMethodList: function (MethodList) {
paymentMethodlist(MethodList); paymentMethodlist(MethodList);
}, },
...@@ -132,6 +126,15 @@ define([ ...@@ -132,6 +126,15 @@ define([
return paymentMethodlist; return paymentMethodlist;
}, },
setShippingSaveMethod: function (Method) {
shippingSaveMethod(Method);
},
getShippingSaveMethod: function () {
return shippingSaveMethod;
},
/** /**
* @return {*} * @return {*}
*/ */
......
...@@ -57,6 +57,10 @@ define([ ...@@ -57,6 +57,10 @@ define([
).done(function (result) { ).done(function (result) {
var new_sh = []; var new_sh = [];
new_sh.push(result[0]); new_sh.push(result[0]);
if(result.length > 1)
{
quote.setShippingSaveMethod(result[1]);
}
rateRegistry.set(address.getCacheKey(), result); rateRegistry.set(address.getCacheKey(), result);
shippingService.setShippingRates(new_sh); shippingService.setShippingRates(new_sh);
}).fail(function (response) { }).fail(function (response) {
......
...@@ -178,14 +178,14 @@ define([ ...@@ -178,14 +178,14 @@ define([
} }
} }
var data = setBillingAddressAction(globalMessageList); var data = setBillingAddressAction(globalMessageList);
if(data.status == 200) // if(data.status == 200)
{ // {
this.isAddressDetailsVisible(true); // this.isAddressDetailsVisible(true);
} // }
else // else
{ // {
this.isAddressDetailsVisible(false); // this.isAddressDetailsVisible(false);
} // }
this.updateAddresses(); this.updateAddresses();
......
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
define([
'jquery',
'uiComponent',
'mage/mage'
], function ($, Component) {
'use strict';
return Component.extend({
defaults: {
template: 'Magento_Checkout/checkout-index-footer'
}
});
});
...@@ -54,6 +54,7 @@ define([ ...@@ -54,6 +54,7 @@ define([
isCustomerLoggedIn: customer.isLoggedIn, isCustomerLoggedIn: customer.isLoggedIn,
forgotPasswordUrl: window.checkoutConfig.forgotPasswordUrl, forgotPasswordUrl: window.checkoutConfig.forgotPasswordUrl,
emailCheckTimeout: 0, emailCheckTimeout: 0,
visible: ko.observable(window.checkoutConfig.addressVisible),
/** /**
* Initializes regular properties of instance. * Initializes regular properties of instance.
...@@ -79,7 +80,6 @@ define([ ...@@ -79,7 +80,6 @@ define([
return this; return this;
}, },
/** /**
* Callback on changing email property * Callback on changing email property
*/ */
......
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
define([
'jquery',
'uiComponent',
'ko',
'Magento_Checkout/js/model/quote',
'mage/mage'
], function ($, Component,ko,quote) {
'use strict';
return Component.extend({
defaults: {
template: 'Magento_Checkout/logo-nav'
},
visible: ko.observable(!quote.isVirtual()) && ko.observable(window.checkoutConfig.addressVisible),
shippingVisible: ko.observable(window.checkoutConfig.shippingVisible),
paymentVisible: ko.observable(window.checkoutConfig.paymentVisible),
getLogoSrc: function(){
return window.checkoutConfig.logosrc;
},
breadcrumbReturnToCart: function(){
$.mage.redirect(window.checkoutConfig.cartUrl);
},
isMobile: function(){
return window.checkoutConfig.isMobile;
}
});
});
define([ define([
'jquery', 'jquery',
'ko',
'uiComponent', 'uiComponent',
'uiRegistry', 'uiRegistry',
'Magento_Checkout/js/model/checkout-data-resolver', 'Magento_Checkout/js/model/checkout-data-resolver',
'Magento_Checkout/js/model/quote' 'Magento_Checkout/js/model/quote'
], function ($, Component,registry,checkoutDataResolver,quote) { ], function ($, ko, Component,registry,checkoutDataResolver,quote) {
'use strict'; 'use strict';
var input_city = $('#co-shipping-form input[name="city"]'); var input_city = $('#co-shipping-form input[name="city"]');
...@@ -12,24 +13,38 @@ define([ ...@@ -12,24 +13,38 @@ define([
input_city.attr('required',true); input_city.attr('required',true);
input_city.attr('_required',true); input_city.attr('_required',true);
} }
var addressOneVisible = ko.observable(true),
shippingTwoVisible = ko.observable(false),
paymentThreeVisible = ko.observable(false);
return Component.extend({ return Component.extend({
addressOneVisible: addressOneVisible,
shippingTwoVisible: shippingTwoVisible,
paymentThreeVisible: paymentThreeVisible,
initialize: function () { initialize: function () {
this.initStep(); this.initStep(this);
this._super(); this._super();
return this; return this;
}, },
initStep: function () { initStep: function (obj) {
$(document).on('click', '#next-shipping>span', function () { $(document).on('click','.continue-shipping',function(){
$('#next-shipping>span').addClass('pleaseWait');
setTimeout(function(){
$('#next-shipping>span').removeClass("pleaseWait"); console.log('addressOneVisible',addressOneVisible());
}, 600); if(shippingTwoVisible() || paymentThreeVisible())
{
obj.backToInformation();
return false;
}
var loginForm = $('.form.form-login'); var loginForm = $('.form.form-login');
var addressForm = $('#checkout-step-shipping>#co-shipping-form'); var addressForm = $('#checkout-step-shipping>#co-shipping-form');
if (loginForm.length > 0 && !loginForm.validate().form()) { if (loginForm.length > 0 && !loginForm.validate().form()) {
return false; return false;
} }
var shippingString = '';
var email = '';
if (addressForm.length > 0) { if (addressForm.length > 0) {
if (!$('#co-shipping-form input[name="region"]').closest('.field').hasClass('_required')) { if (!$('#co-shipping-form input[name="region"]').closest('.field').hasClass('_required')) {
$('#co-shipping-form input[name="region"]').removeAttr('required'); $('#co-shipping-form input[name="region"]').removeAttr('required');
...@@ -57,6 +72,10 @@ define([ ...@@ -57,6 +72,10 @@ define([
$(selectInput[i]).removeAttr('name') $(selectInput[i]).removeAttr('name')
} }
} }
if ($(window).width() < 768) {
var scrollTop = $('#opc-shipping_method').offset().top - 100;
$('html,body').animate({scrollTop: scrollTop}, 'fast');
}
return false; return false;
} }
...@@ -65,12 +84,7 @@ define([ ...@@ -65,12 +84,7 @@ define([
$(selectInput[i]).removeAttr('name') $(selectInput[i]).removeAttr('name')
} }
} }
var paymentMethodObj = $('.checkout-index-index .payment-method'); email = $('#customer-emails').val() || '';
if(paymentMethodObj.length < 1)
{
return false;
}
var email = $('#customer-email').val() || '';
var firstname = $('#co-shipping-form input[name="firstname"]').val(); var firstname = $('#co-shipping-form input[name="firstname"]').val();
var lastname = $('#co-shipping-form input[name="lastname"]').val(); var lastname = $('#co-shipping-form input[name="lastname"]').val();
var street = $('#co-shipping-form input[name="street[0]"]').val(); var street = $('#co-shipping-form input[name="street[0]"]').val();
...@@ -84,120 +98,160 @@ define([ ...@@ -84,120 +98,160 @@ define([
} else { } else {
regin = region_select.find(":selected").text(); regin = region_select.find(":selected").text();
} }
if(!registry.get('checkout.steps.shipping-step.shippingAddress.after-shipping-method-form.billing-address-form').isAddressSameAsShipping()) shippingString = firstname + ' ' + lastname + ',' + street + ',' + city + ', ' + regin + ', ' + country + ',' + postcode + ', ' + telephone;
{ }
var billadressForm = $('.checkout-billing-address form'); $('.address-one').hide();
$('.shipping-two').show();
$('#email-text').show();
$('#email-text .main-text').html(email);
$('#shipping-text').show();
$('.payment-content').show();
$('#shipping-text .main-text').html(shippingString);
$('#breadcrumb-fill-info').addClass('custom-link-color');
$('#breadcrumb-logistics').removeClass('trade_checkout_step_waiting');
addressOneVisible(false);
shippingTwoVisible(true);
//quote.billAddressMent(true);
checkoutDataResolver.resolveEstimationAddress();
});
if(billadressForm.length > 0) $(document).on('click','.continue-payment',function() {
{
if (!$('.checkout-billing-address input[name="region"]').closest('.field').hasClass('_required')) {
$('.checkout-billing-address input[name="region"]').removeAttr('required');
}
if (!$('.checkout-billing-address input[name="street[1]"]').closest('.field').hasClass('_required')) {
$('.checkout-billing-address input[name="street[1]"]').removeAttr('required');
}
if (!$('.checkout-billing-address input[name="company"]').closest('.field').hasClass('_required')) {
$('.checkout-billing-address input[name="company"]').removeAttr('required');
}
var region_select = $('.checkout-billing-address select[name="region_id"]');
if (region_select.is(':visible') && region_select.closest('.field').hasClass('_required')) {
region_select.attr('required',true);
}
if(addressOneVisible() || !shippingTwoVisible())
{
obj.backToInformation();
return false;
}
var paymentMethodObj = $('.checkout-index-index .payment-method');
if(paymentMethodObj.length < 1)
{
return false;
}
var selectInput = $('.checkout-billing-address .select-input'); var inputChecked = $('#checkout-shipping-method-load').find('input:radio:checked');
if(selectInput.length > 0){ var shippingPrice = $(inputChecked).siblings('.col-amount').html();
for(var i=0;i<selectInput.length;i++){ var shipString = $(inputChecked).siblings('.col-carrier').html() +
var selectName = $(selectInput[i]).next('select').attr('name'); ' ' + '<span class="price">' + shippingPrice + '</span>';
$(selectInput[i]).attr('name',selectName)
} $('#breadcrumb-logistics').addClass('custom-link-color');
} $('#breadcrumb-payment').removeClass('trade_checkout_step_waiting');
if (!billadressForm.validate().form()) {
if(selectInput.length > 0){
for(var i=0;i<selectInput.length;i++){
$(selectInput[i]).removeAttr('name') $(paymentMethodObj[0]).find('input[type="radio"]').trigger('click');
} $('#shipping-text .trade_info-preview-item').addClass('mian-text-line');
} $('.shipping-two').hide();
return false; $('.payment-three').show();
} $('#method-text .main-text').html(shipString);
shippingTwoVisible(false);
paymentThreeVisible(true);
});
$(document).on('click','.complete-order',function() {
if(!paymentThreeVisible())
{
obj.backToInformation();
return false;
}
$('.waitBtn').show();
$('.complete-order').hide();
if(!registry.get('checkout.steps.shipping-step.shippingAddress.after-shipping-method-form.billing-address-form').isAddressSameAsShipping())
{
var billadressForm = $('.checkout-billing-address form');
if(billadressForm.length > 0)
{
if (!$('.checkout-billing-address input[name="region"]').closest('.field').hasClass('_required')) {
$('.checkout-billing-address input[name="region"]').removeAttr('required');
}
if (!$('.checkout-billing-address input[name="street[1]"]').closest('.field').hasClass('_required')) {
$('.checkout-billing-address input[name="street[1]"]').removeAttr('required');
}
if (!$('.checkout-billing-address input[name="company"]').closest('.field').hasClass('_required')) {
$('.checkout-billing-address input[name="company"]').removeAttr('required');
}
var region_select = $('.checkout-billing-address select[name="region_id"]');
if (region_select.is(':visible') && region_select.closest('.field').hasClass('_required')) {
region_select.attr('required',true);
}
var selectInput = $('.checkout-billing-address .select-input');
if(selectInput.length > 0){
for(var i=0;i<selectInput.length;i++){
var selectName = $(selectInput[i]).next('select').attr('name');
$(selectInput[i]).attr('name',selectName)
}
}
if (!billadressForm.validate().form()) {
if(selectInput.length > 0){ if(selectInput.length > 0){
for(var i=0;i<selectInput.length;i++){ for(var i=0;i<selectInput.length;i++){
$(selectInput[i]).removeAttr('name') $(selectInput[i]).removeAttr('name')
} }
} }
}else { $('.waitBtn').hide();
$('.complete-order').show();
return false; return false;
} }
$('#submitBill').trigger('click'); if(selectInput.length > 0){
if(quote.responseBillStatus() == 400) for(var i=0;i<selectInput.length;i++){
{ $(selectInput[i]).removeAttr('name')
return false; }
} }
}else {
$('.waitBtn').hide();
$('.complete-order').show();
return false;
} }
$('#checkout-step-shipping').hide(); $('#submitBill').trigger('click');
$('#shipping-text').show(); if(quote.responseBillStatus() == 400)
$('#shipping-text .main-address.shipping-address').html(firstname + ' ' + lastname + '<br>' + street + '<br>' + city + ', ' + regin + ', ' + country + '<br>' + postcode + ', ' + telephone + '<br>' + email); {
} $('.waitBtn').hide();
$(paymentMethodObj[0]).find('input[type="radio"]').trigger('click'); $('.complete-order').show();
$('#next-shipping').hide(); return false;
$('#edit-shipping').show(); }
$('#checkout-step-shipping_method').show();
$('#checkout-payment-method-load').show();
$('#checkout-step-payment,#opc-shipping_method').find('.step-title').removeClass('no-border');
if ($(window).width() < 768) {
var scrollTop = $('#opc-shipping_method').offset().top - 100;
$('html,body').animate({scrollTop: scrollTop}, 'fast');
} }
checkoutDataResolver.resolveEstimationAddress();
quote.billAddressMent(true);
});
$(document).on('click', '#shipping-text .address-edit', function () { $('.checkout-index-index .payment-method._active').find('.actions-toolbar').find('button').trigger('click');
$('#shipping-text .main-address.shipping-address').html('');
$('#checkout_place_order').removeClass('button-fix');
$('#shipping-text').hide();
$('#checkout-step-shipping').show();
$('#next-shipping').show();
$('#edit-shipping').hide();
$('#checkout-step-shipping_method').hide();
$('#checkout-payment-method-load').hide();
$('#checkout-step-payment,#opc-shipping_method').find('.step-title').addClass('no-border');
}); });
$(document).on('click', '#billing-address-same-as-shipping-shared', function () { $(document).on('click','.back-to-information,.trade_checkout_step_doing.custom-link-color,.right-email,.right-address',function() {
obj.backToInformation();
if(!registry.get('checkout.steps.shipping-step.shippingAddress.after-shipping-method-form.billing-address-form').isAddressSameAsShipping())
{
$('#shipping-text .main-address.shipping-address').html('');
$('#checkout_place_order').removeClass('button-fix');
$('#shipping-text').hide();
$('#checkout-step-shipping').show();
$('#next-shipping').show();
$('#edit-shipping').hide();
$('#checkout-step-shipping_method').hide();
$('#checkout-payment-method-load').hide();
$('#checkout-step-payment,#opc-shipping_method').find('.step-title').addClass('no-border');
}
}); });
$(document).on('click', '#editLink', function () { $(document).on('click','.back-to-shipping,.shipping-btn.custom-link-color,.right-method',function() {
$('#shipping-text .main-address.shipping-address').html(''); if(shippingTwoVisible() || !paymentThreeVisible())
$('#checkout_place_order').removeClass('button-fix');
$('#shipping-text').hide();
$('#checkout-step-shipping').show();
$('#next-shipping').show();
$('#edit-shipping').hide();
$('#checkout-step-shipping_method').hide();
$('#checkout-payment-method-load').hide();
$('#checkout-step-payment,#opc-shipping_method').find('.step-title').addClass('no-border');
if(!registry.get('checkout.steps.shipping-step.shippingAddress.after-shipping-method-form.billing-address-form').isAddressSameAsShipping())
{ {
$('#action-edit-address').trigger('click'); obj.backToInformation();
return false;
} }
quote.billAddressMent(false); $('.shipping-two').show();
$('.payment-three').hide();
$('#method-text .main-text').html('');
$('#method-text').hide();
this.shippingTwoVisible(true);
this.paymentThreeVisible(false);
}); });
$(document).on('click','.mobile-control',function() {
var flag = $(this).parent().attr('aria-expanded');
if(flag == 'true') {
$('.opc-block-summary').show();
$('.items-in-cart').removeClass('bottom-border');
} else {
$('.opc-block-summary').hide();
$('.items-in-cart').addClass('bottom-border');
}
});
},
backToInformation: function(){
$('.address-one').show();
$('.shipping-two').hide();
$('.payment-three').hide();
$('.checkout-top-page .main-text').html('');
$('.checkout-top-page').hide();
$('.payment-content').hide();
paymentThreeVisible(true);
shippingTwoVisible(false);
paymentThreeVisible(false);
} }
}); });
} }
......
...@@ -39,6 +39,8 @@ define([ ...@@ -39,6 +39,8 @@ define([
activeMethod: '' activeMethod: ''
}, },
isVisible: ko.observable(quote.isVirtual()), isVisible: ko.observable(quote.isVirtual()),
paymentVisible: ko.observable(window.checkoutConfig.paymentVisible),
isLoading: paymentService.isLoading,
quoteIsVirtual: quote.isVirtual(), quoteIsVirtual: quote.isVirtual(),
isPaymentMethodsAvailable: ko.computed(function () { isPaymentMethodsAvailable: ko.computed(function () {
return paymentService.getAvailablePaymentMethods().length > 0; return paymentService.getAvailablePaymentMethods().length > 0;
......
...@@ -149,14 +149,15 @@ define([ ...@@ -149,14 +149,15 @@ define([
} }
} }
).always( ).always(
function () { function () {
self.isPlaceOrderActionAllowed(true); self.isPlaceOrderActionAllowed(true);
} }
); );
return true; return true;
} }
$('.waitBtn').hide();
$('.complete-order').show();
return false; return false;
}, },
......
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
define([
'jquery',
'uiComponent',
'mage/mage'
], function ($, Component) {
'use strict';
return Component.extend({
defaults: {
template: 'Magento_Checkout/paypal'
},
paypalCheckout: function(){
var returnUrl = $('input[data-action="checkout-form-submit"]').attr('data-checkout-url');
var y=(window.screen.availHeight-657);
var x=(window.screen.availWidth-535);
var mywindow = window.open(returnUrl, "_blank", "height=657,width=535,scrollbars=yes,resizable=1,modal=false,alwaysRaised=yes");
mywindow.moveTo(x/2,y/2);
}
});
});
...@@ -73,7 +73,10 @@ define([ ...@@ -73,7 +73,10 @@ define([
isNewAddressAdded: ko.observable(false), isNewAddressAdded: ko.observable(false),
saveInAddressBook: 1, saveInAddressBook: 1,
quoteIsVirtual: quote.isVirtual(), quoteIsVirtual: quote.isVirtual(),
addressVisible: ko.observable(!quote.isVirtual() && window.checkoutConfig.addressVisible),
shippingVisible: ko.observable(window.checkoutConfig.shippingVisible),
paymentVisible: ko.observable(window.checkoutConfig.paymentVisible),
textVisible: ko.observable(false),
/** /**
* @return {exports} * @return {exports}
*/ */
...@@ -382,6 +385,9 @@ define([ ...@@ -382,6 +385,9 @@ define([
if (this.source.get('shippingAddress.custom_attributes')) { if (this.source.get('shippingAddress.custom_attributes')) {
this.source.trigger('shippingAddress.custom_attributes.data.validate'); this.source.trigger('shippingAddress.custom_attributes.data.validate');
} }
},
backToCart: function(){
$.mage.redirect(window.checkoutConfig.cartUrl);
} }
}); });
}); });
...@@ -72,7 +72,7 @@ define([ ...@@ -72,7 +72,7 @@ define([
return priceUtils.formatPrice(price, quote.getPriceFormat()); return priceUtils.formatPrice(price, quote.getPriceFormat());
}, },
getGrandTotal:function(){ getGrandTotal:function(){
return this.getFormattedPrice(this.totals['subtotal']); return this.getFormattedPrice(this.totals['base_grand_total']);
}, },
/** /**
* Set items to observable field * Set items to observable field
...@@ -93,6 +93,9 @@ define([ ...@@ -93,6 +93,9 @@ define([
*/ */
isItemsBlockExpanded: function () { isItemsBlockExpanded: function () {
return quote.isVirtual() || stepNavigator.isProcessed('shipping'); return quote.isVirtual() || stepNavigator.isProcessed('shipping');
},
isMobile: function(){
return window.checkoutConfig.isMobile;
} }
}); });
}); });
...@@ -51,11 +51,10 @@ define([ ...@@ -51,11 +51,10 @@ define([
} }
if (typeof shippingMethod['method_title'] !== 'undefined') { if (typeof shippingMethod['method_title'] !== 'undefined') {
shippingMethodTitle = ' - ' + shippingMethod['method_title']; shippingMethodTitle = shippingMethod['method_title'];
} }
return shippingMethodTitle ? return shippingMethodTitle ? shippingMethodTitle :
shippingMethod['carrier_title'] + shippingMethodTitle :
shippingMethod['carrier_title']; shippingMethod['carrier_title'];
}, },
getShippingSaveMethodTitle: function () { getShippingSaveMethodTitle: function () {
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
*/ */
--> -->
<div class="field field-select-billing"> <div class="field field-select-billing">
<label class="label"><span data-bind="i18n: 'Billing Address'"></span></label> <label class="label-title step-title"><span data-bind="i18n: 'Billing Address'"></span></label>
<div class="control" data-bind="if: (addressOptions.length > 1)"> <div class="control" data-bind="if: (addressOptions.length > 1)">
<select class="select" name="billing_address_id" data-bind=" <select class="select" name="billing_address_id" data-bind="
options: addressOptions, options: addressOptions,
......
<div class="trade-checkout-whole-footer__baseline sl_section--small"></div>
<div class="copyright_block" data-testid="checkout-ntfht">
<div id="shopline-section-trade/policy_description" class="shopline-section"><div class="checkout-description-footer ">
<footer id="policy-description" class="checkout_policy_description" trade-btn-event-name="trade:showPolicyModal" data-testid="checkout-dtv5i">
<ul>
<li>
<a class="custom-link-color" href="/return-exchange-policy" target="_blank">Refund Policy</a>
</li>
<li>
<a class="custom-link-color" href="/shipping-policy" target="_blank">Shipping policy</a>
</li>
<li>
<a class="custom-link-color" href="/security-privacy-policy" target="_blank">Privacy Policy</a>
</li>
<li>
<a class="custom-link-color" href="/terms-of-use" target="_blank">Terms of service</a>
</li>
</ul>
</footer>
</div>
</div>
<div id="shopline-section-trade/copy_rights" class="shopline-section"><footer class="checkout_copy_right primary-text hide" role="contentinfo">
© 2023 ChicCurve. All Rights Reserved.
</footer></div>
</div>
\ No newline at end of file
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<header class="pc_logo">
<div id="joshine-section-header_logo" class="joshine-section">
<h1 class="logo_container logo_container_checkout header_logo--img align-center pc can_click" data-logo="logo" id="trade_logo" data-testid="checkout-zhn03">
<div class="logo_inner size-medium">
<a title="" href="/" data-testid="checkout-syuyl"><img data-bind="attr: {'src': getLogoSrc()}" alt="JOSHINE"></a>
</div>
</h1>
</div>
</header>
<!-- ko if: isMobile() -->
<!-- ko foreach: getRegion('logo-nav-sidebar') -->
<!-- ko template: getTemplate() --><!-- /ko -->
<!--/ko-->
<!--/ko-->
<header class="main__header" role="banner">
<div id="joshine-section-trade/checkout_breadcrumb" class="joshine-section"><div class="trade_checkout_breadcrumb trade_checkout_breadcrumb_checkout logo-align-center">
<button type="button" id="breadcrumb-return-to-cart"
data-step=""
trade-btn-event-name="trade:breadcrumb-return-to-cart"
class="trade_checkout_breadcrumb_button trade_checkout_step_done custom-link-color trade-checkout-btn"
data-bind="click: breadcrumbReturnToCart">
<div class="trade_checkout_steps_stepItem">
<span class="text">Cart</span>
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M5.96967 12.0303C5.67678 11.7374 5.67678 11.2626 5.96967 10.9697L8.93934 8L5.96967 5.03033C5.67678 4.73744 5.67678 4.26256 5.96967 3.96967C6.26256 3.67678 6.73744 3.67678 7.03033 3.96967L10.5303 7.46967C10.8232 7.76256 10.8232 8.23744 10.5303 8.53033L7.03033 12.0303C6.73744 12.3232 6.26256 12.3232 5.96967 12.0303Z" fill="#959595"></path>
</svg>
</div>
</button>
<button type="button"
id="breadcrumb-fill-info"
data-step="contact_information"
trade-btn-event-name="trade:breadcrumb-fill-info"
class="trade_checkout_breadcrumb_button trade_checkout_step_doing primary-text trade-checkout-btn"
data-bind="css: { trade_checkout_step_waiting: !visible() }">
<div class="trade_checkout_steps_stepItem"><span class="text">Information</span>
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M5.96967 12.0303C5.67678 11.7374 5.67678 11.2626 5.96967 10.9697L8.93934 8L5.96967 5.03033C5.67678 4.73744 5.67678 4.26256 5.96967 3.96967C6.26256 3.67678 6.73744 3.67678 7.03033 3.96967L10.5303 7.46967C10.8232 7.76256 10.8232 8.23744 10.5303 8.53033L7.03033 12.0303C6.73744 12.3232 6.26256 12.3232 5.96967 12.0303Z" fill="#959595"></path>
</svg>
</div>
</button>
<button type="button"
id="breadcrumb-logistics"
data-step="shipping_method"
trade-btn-event-name="trade:breadcrumb-logistics"
class="trade_checkout_breadcrumb_button shipping-btn primary-text trade-checkout-btn"
data-bind="css: { trade_checkout_step_waiting: !shippingVisible() }">
<div class="trade_checkout_steps_stepItem"><span class="text" data-text="Shipping">Shipping</span>
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M5.96967 12.0303C5.67678 11.7374 5.67678 11.2626 5.96967 10.9697L8.93934 8L5.96967 5.03033C5.67678 4.73744 5.67678 4.26256 5.96967 3.96967C6.26256 3.67678 6.73744 3.67678 7.03033 3.96967L10.5303 7.46967C10.8232 7.76256 10.8232 8.23744 10.5303 8.53033L7.03033 12.0303C6.73744 12.3232 6.26256 12.3232 5.96967 12.0303Z" fill="#959595"></path>
</svg>
</div>
</button>
<button type="button"
id="breadcrumb-payment"
data-step="payment_method"
trade-btn-event-name="trade:breadcrumb-payment"
class="trade_checkout_breadcrumb_button primary-text trade-checkout-btn"
data-bind="css: { trade_checkout_step_waiting: !paymentVisible() }">
<div class="trade_checkout_steps_stepItem"><span class="text">Payment</span>
</div>
</button>
</div></div>
</header>
\ No newline at end of file
...@@ -9,6 +9,16 @@ ...@@ -9,6 +9,16 @@
<div repeat="foreach: paymentGroupsList, item: '$group'" <div repeat="foreach: paymentGroupsList, item: '$group'"
class="payment-group"> class="payment-group">
<each args="data: getRegion($group().displayArea), as: 'method'" render=""></each> <each args="data: getRegion($group().displayArea), as: 'method'" render=""></each>
<div class="group-item-body payment__body KlarnaBNPL has_content payment__body--online" ><div>
<svg width="143" height="100" viewBox="0 0 200 140" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M175 70V24C175 20.6863 172.314 18 169 18H15C11.6863 18 9 20.6863 9 24V116C9 119.314 11.6863 122 15 122H169C172.314 122 175 119.314 175 116V84.9259" stroke="currentColor" stroke-width="3"></path>
<path d="M9 36H175" stroke="currentColor" stroke-width="3"></path>
<circle cx="18" cy="27" r="3" fill="currentColor"></circle>
<circle cx="28" cy="27" r="3" fill="currentColor"></circle>
<circle cx="38" cy="27" r="3" fill="currentColor"></circle>
<path d="M146.5 77H197M197 77L189 69M197 77L189 85" stroke="currentColor" stroke-width="3"></path>
</svg>
<div>After clicking 'Complete Order', you will be redirected to the payment page to securely complete the payment.</div></div></div>
</div> </div>
</div> </div>
<div ifnot="isPaymentMethodsAvailable()" <div ifnot="isPaymentMethodsAvailable()"
......
...@@ -4,12 +4,12 @@ ...@@ -4,12 +4,12 @@
* See COPYING.txt for license details. * See COPYING.txt for license details.
*/ */
--> -->
<li id="payment" role="presentation" class="checkout-payment-method"> <li id="payment" role="presentation" class="checkout-payment-method payment-three" data-bind="fadeVisible: paymentVisible(), blockLoader: isLoading" style="order:4;">
<div id="checkout-step-payment" <div id="checkout-step-payment"
class="step-content" class="step-content"
data-role="content" data-role="content"
role="tabpanel" role="tabpanel"
aria-hidden="false"> aria-hidden="false" >
<!-- ko if: (quoteIsVirtual) --> <!-- ko if: (quoteIsVirtual) -->
<!-- ko foreach: getRegion('customer-email') --> <!-- ko foreach: getRegion('customer-email') -->
<!-- ko template: getTemplate() --><!-- /ko --> <!-- ko template: getTemplate() --><!-- /ko -->
...@@ -18,15 +18,12 @@ ...@@ -18,15 +18,12 @@
<form id="co-payment-form" class="form payments" novalidate="novalidate"> <form id="co-payment-form" class="form payments" novalidate="novalidate">
<input data-bind='attr: {value: getFormKey()}' type="hidden" name="form_key"/> <input data-bind='attr: {value: getFormKey()}' type="hidden" name="form_key"/>
<fieldset class="fieldset"> <fieldset class="fieldset">
<p class="step-title no-border"> <p class="step-title no-border label-title">
<!-- ko ifnot: (quoteIsVirtual) --> <span translate="'Payment Method'"/>
<span class="number">
<span translate="'3'" />
</span>
<!--/ko-->
<span translate="'Payment Method'" />
</p> </p>
<h5 class="block-select-subtitle">
All transactions are secure and encrypted.
</h5>
<!-- ko foreach: getRegion('beforeMethods') --> <!-- ko foreach: getRegion('beforeMethods') -->
...@@ -42,7 +39,7 @@ ...@@ -42,7 +39,7 @@
</div> </div>
<!--/ko--> <!--/ko-->
<!-- ko ifnot: (quoteIsVirtual) --> <!-- ko ifnot: (quoteIsVirtual) -->
<div id="checkout-payment-method-load" class="opc-payment dispay-solid" data-bind="visible: isPaymentMethodsAvailable"> <div id="checkout-payment-method-load" class="opc-payment" data-bind="visible: isPaymentMethodsAvailable">
<!-- ko foreach: getRegion('payment-methods-list') --> <!-- ko foreach: getRegion('payment-methods-list') -->
<!-- ko template: getTemplate() --><!-- /ko --> <!-- ko template: getTemplate() --><!-- /ko -->
<!-- /ko --> <!-- /ko -->
......
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<div id="trade-checkout-smartpay" class="address-one">
<div id="trade-paypal-express">
<h2 class="trade_checkout__exp__title">
Express Checkout
</h2>
<div data-label="or" class="paypal checkout after paypal-logo">
<div class="checkout-logo-medium" data-bind="click: paypalCheckout">
<input type="image" data-action="checkout-form-submit" data-checkout-url="/paypal/express/start/button/1/" src="/static/frontend/Joshine/breeze/en_US/Magento_Paypal/images/paypal.png" alt="Checkout with PayPal" title="Checkout with PayPal">
<div class="checkout-txt" style="display:contents;"></div>
</div>
</div>
<div class="trade_checkout__exp__line">
<span class="lineLeft"></span>
<span class="lineText">
OR
</span>
<span class="lineRight"></span>
</div>
</div>
</div>
\ No newline at end of file
...@@ -5,6 +5,9 @@ ...@@ -5,6 +5,9 @@
*/ */
--> -->
<div id="opc-sidebar"> <div id="opc-sidebar">
<!-- ko foreach: getRegion('estimation') -->
<!-- ko template: getTemplate() --><!-- /ko -->
<!--/ko-->
<!-- ko foreach: getRegion('summary') --> <!-- ko foreach: getRegion('summary') -->
<!-- ko template: getTemplate() --><!-- /ko --> <!-- ko template: getTemplate() --><!-- /ko -->
......
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
*/ */
--> -->
<div class="opc-block-summary" data-bind="blockLoader: isLoading"> <div class="opc-block-summary" data-bind="blockLoader: isLoading">
<span data-bind="i18n: 'Order Summary'" class="title"></span>
<!-- ko foreach: elems() --> <!-- ko foreach: elems() -->
<!-- ko template: getTemplate() --><!-- /ko --> <!-- ko template: getTemplate() --><!-- /ko -->
<!-- /ko --> <!-- /ko -->
......
...@@ -91,7 +91,11 @@ define([ ...@@ -91,7 +91,11 @@ define([
$form.trigger('submit'); $form.trigger('submit');
} else { } else {
$.mage.redirect(returnUrl); var y=(window.screen.availHeight-657);
var x=(window.screen.availWidth-535);
var mywindow = window.open(returnUrl, "_blank", "height=657,width=535,scrollbars=yes,resizable=1,modal=false,alwaysRaised=yes");
mywindow.moveTo(x/2,y/2);
//$.mage.redirect(returnUrl);
} }
} }
}); });
......
...@@ -13,29 +13,29 @@ ...@@ -13,29 +13,29 @@
<item name="components" xsi:type="array"> <item name="components" xsi:type="array">
<item name="checkout" xsi:type="array"> <item name="checkout" xsi:type="array">
<item name="children" xsi:type="array"> <item name="children" xsi:type="array">
<!--<item name="steps" xsi:type="array"> <item name="logo-nav" xsi:type="array">
<item name="children" xsi:type="array"> <item name="children" xsi:type="array">
<item name="billing-step" xsi:type="array"> <item name="logo-nav-sidebar" xsi:type="array">
<item name="component" xsi:type="string">uiComponent</item>
<item name="children" xsi:type="array"> <item name="children" xsi:type="array">
<item name="payment" xsi:type="array"> <item name="summary" xsi:type="array">
<item name="children" xsi:type="array"> <item name="children" xsi:type="array">
<item name="afterMethods" xsi:type="array">
<item name="discount" xsi:type="array">
<item name="component" xsi:type="string">Magento_SalesRule/js/view/payment/discount</item>
<item name="children" xsi:type="array">
<item name="errors" xsi:type="array">
<item name="sortOrder" xsi:type="string">4</item>
<item name="component" xsi:type="string">Magento_SalesRule/js/view/payment/discount-messages</item>
<item name="displayArea" xsi:type="string">messages</item>
</item>
</item>
</item>
<item name="totals" xsi:type="array">
<item name="children" xsi:type="array"> <item name="children" xsi:type="array">
<item name="discount" xsi:type="array"> <item name="discount" xsi:type="array">
<item name="component" xsi:type="string">Magento_SalesRule/js/view/payment/discount</item> <item name="component" xsi:type="string">Magento_SalesRule/js/view/summary/discount</item>
<item name="children" xsi:type="array"> <item name="config" xsi:type="array">
<item name="errors" xsi:type="array"> <item name="title" xsi:type="string" translate="true">Discount</item>
<item name="sortOrder" xsi:type="string">0</item>
<item name="component" xsi:type="string">Magento_SalesRule/js/view/payment/discount-messages</item>
<item name="displayArea" xsi:type="string">messages</item>
</item>
<item name="captcha" xsi:type="array">
<item name="component" xsi:type="string">Magento_SalesRule/js/view/payment/captcha</item>
<item name="displayArea" xsi:type="string">captcha</item>
<item name="formId" xsi:type="string">sales_rule_coupon_request</item>
<item name="configSource" xsi:type="string">checkoutConfig</item>
</item>
</item> </item>
</item> </item>
</item> </item>
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
</item> </item>
</item> </item>
</item> </item>
</item>--> </item>
<item name="sidebar" xsi:type="array"> <item name="sidebar" xsi:type="array">
<item name="children" xsi:type="array"> <item name="children" xsi:type="array">
<item name="summary" xsi:type="array"> <item name="summary" xsi:type="array">
......
...@@ -7,7 +7,19 @@ ...@@ -7,7 +7,19 @@
<?php <?php
/** @var $block \Magento\Swatches\Block\Product\Renderer\Configurable */ /** @var $block \Magento\Swatches\Block\Product\Renderer\Configurable */
/** @var \Magento\Swatches\ViewModel\Product\Renderer\Configurable $configurableViewModel */ /** @var \Magento\Swatches\ViewModel\Product\Renderer\Configurable $configurableViewModel */
$configurableViewModel = $block->getConfigurableViewModel() $configurableViewModel = $block->getConfigurableViewModel();
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$chartBlock = $objectManager->get(\Magepow\Sizechart\Block\Product\Sizechart::class);
$sizeChart = $chartBlock->getSizeChart();
$chartTableArray = [];
if ($sizeChart != null) {
$chartTable = $sizeChart->getData('custom_size');
$chartTableArray = $chartTable;
}
$chartTableArray = json_encode($chartTableArray, true);
?> ?>
<div class="swatch-opt" data-role="swatch-options"></div> <div class="swatch-opt" data-role="swatch-options"></div>
...@@ -20,7 +32,8 @@ $configurableViewModel = $block->getConfigurableViewModel() ...@@ -20,7 +32,8 @@ $configurableViewModel = $block->getConfigurableViewModel()
"mediaCallback": "<?= $block->escapeJs($block->escapeUrl($block->getMediaCallback())) ?>", "mediaCallback": "<?= $block->escapeJs($block->escapeUrl($block->getMediaCallback())) ?>",
"gallerySwitchStrategy": "<?= $block->escapeJs($block->getVar('gallery_switch_strategy', 'Magento_ConfigurableProduct')) ?: 'replace'; ?>", "gallerySwitchStrategy": "<?= $block->escapeJs($block->getVar('gallery_switch_strategy', 'Magento_ConfigurableProduct')) ?: 'replace'; ?>",
"jsonSwatchImageSizeConfig": <?= /* @noEscape */ $block->getJsonSwatchSizeConfig() ?>, "jsonSwatchImageSizeConfig": <?= /* @noEscape */ $block->getJsonSwatchSizeConfig() ?>,
"showTooltip": <?= $block->escapeJs($configurableViewModel->getShowSwatchTooltip()) ?> "showTooltip": <?= $block->escapeJs($configurableViewModel->getShowSwatchTooltip()) ?>,
"sizeChartData": <?= $chartTableArray ?>
} }
}, },
"*" : { "*" : {
......
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
<?= /* @noEscape */ $headAdditional ?> <?= /* @noEscape */ $headAdditional ?>
</head> </head>
<body data-container="body" <body data-container="body"
data-mage-init='{"loaderAjax": {}, "loader": { "icon": "<?= /* @noEscape */ $loaderIcon ?>"}}'
<?= /* @noEscape */ $bodyAttributes ?>> <?= /* @noEscape */ $bodyAttributes ?>>
<?= /* @noEscape */ $layoutContent ?> <?= /* @noEscape */ $layoutContent ?>
</body> </body>
......
...@@ -16,14 +16,12 @@ var config = { ...@@ -16,14 +16,12 @@ var config = {
'dropdownDialog': 'mage/dropdown', 'dropdownDialog': 'mage/dropdown',
'dropdown': 'mage/dropdowns', 'dropdown': 'mage/dropdowns',
'accordion': 'mage/accordion', 'accordion': 'mage/accordion',
'loader': 'mage/loader',
'tooltip': 'mage/tooltip', 'tooltip': 'mage/tooltip',
'deletableItem': 'mage/deletable-item', 'deletableItem': 'mage/deletable-item',
'itemTable': 'mage/item-table', 'itemTable': 'mage/item-table',
'fieldsetControls': 'mage/fieldset-controls', 'fieldsetControls': 'mage/fieldset-controls',
'fieldsetResetControl': 'mage/fieldset-controls', 'fieldsetResetControl': 'mage/fieldset-controls',
'redirectUrl': 'mage/redirect-url', 'redirectUrl': 'mage/redirect-url',
'loaderAjax': 'mage/loader',
'menu': 'mage/menu', 'menu': 'mage/menu',
'popupWindow': 'mage/popup-window', 'popupWindow': 'mage/popup-window',
'validation': 'mage/validation/validation', 'validation': 'mage/validation/validation',
......
...@@ -491,5 +491,13 @@ define([ ...@@ -491,5 +491,13 @@ define([
isCheckoutIndex: function () { isCheckoutIndex: function () {
return $('body').hasClass('checkout-index-index'); return $('body').hasClass('checkout-index-index');
} }
,
isSelectIndex: function () {
if(this.elementTmpl.indexOf("select") != -1)
{
return true;
}
return false;
}
}); });
}); });
...@@ -343,6 +343,13 @@ define([ ...@@ -343,6 +343,13 @@ define([
}); });
return _.flatten(result); return _.flatten(result);
},
isMobile: function(){
if(/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)) {
return true;
} else {
return false;
}
} }
}); });
}); });
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
* See COPYING.txt for license details. * See COPYING.txt for license details.
*/ */
--> -->
<!-- ko ifnot: isCheckoutIndex() -->
<select class="select" data-bind=" <select class="select" data-bind="
attr: { attr: {
name: inputName, name: inputName,
...@@ -26,32 +25,4 @@ ...@@ -26,32 +25,4 @@
ko.applyBindingsToNode(option, {attr: {disabled: true}}, item); ko.applyBindingsToNode(option, {attr: {disabled: true}}, item);
} }
}" }"
></select> ></select>
<!-- /ko --> \ No newline at end of file
<!-- ko if: isCheckoutIndex() -->
<input class="input-text select-input" type="text" data-bind="value: getPreview(),attr: {
'aria-required': required
}" required readonly="readonly"/>
<select class="select check-select" data-bind="
attr: {
name: inputName,
id: uid,
disabled: disabled,
'aria-describedby': getDescriptionId(),
'aria-required': required,
'aria-invalid': error() ? true : 'false',
placeholder: placeholder
},
hasFocus: focused,
optgroup: options,
value: value,
optionsCaption: caption,
optionsValue: 'value',
optionsText: 'label',
optionsAfterRender: function(option, item) {
if (item && item.disabled) {
ko.applyBindingsToNode(option, {attr: {disabled: true}}, item);
}
}"></select>
<!-- /ko -->
\ No newline at end of file
...@@ -13,43 +13,43 @@ ...@@ -13,43 +13,43 @@
<div class="control" data-bind="css: {'_with-tooltip': element.tooltip}"> <div class="control" data-bind="css: {'_with-tooltip': element.tooltip}">
<!-- ko ifnot: element.hasAddons() --> <!-- ko ifnot: element.hasAddons() -->
<!-- ko template: element.elementTmpl --><!-- /ko --> <!-- ko template: element.elementTmpl --><!-- /ko -->
<!-- /ko --> <!-- /ko -->
<!-- ko if: element.hasAddons() --> <!-- ko if: element.hasAddons() -->
<div class="control-addon"> <div class="control-addon">
<!-- ko template: element.elementTmpl --><!-- /ko --> <!-- ko template: element.elementTmpl --><!-- /ko -->
<!-- ko if: element.addbefore --> <!-- ko if: element.addbefore -->
<label class="addon-prefix" data-bind="attr: { for: element.uid }"><span data-bind="text: element.addbefore"></span></label> <label class="addon-prefix" data-bind="attr: { for: element.uid }"><span data-bind="text: element.addbefore"></span></label>
<!-- /ko --> <!-- /ko -->
<!-- ko if: element.addafter --> <!-- ko if: element.addafter -->
<label class="addon-suffix" data-bind="attr: { for: element.uid }"><span data-bind="text: element.addafter"></span></label> <label class="addon-suffix" data-bind="attr: { for: element.uid }"><span data-bind="text: element.addafter"></span></label>
<!-- /ko --> <!-- /ko -->
</div> </div>
<!-- /ko --> <!-- /ko -->
<!-- ko if: element.tooltip --> <!-- ko if: element.tooltip -->
<!-- ko template: element.tooltipTpl --><!-- /ko --> <!-- ko template: element.tooltipTpl --><!-- /ko -->
<!-- /ko --> <!-- /ko -->
<!-- ko if: element.notice --> <!-- ko if: element.notice -->
<div class="field-note" data-bind="attr: { id: element.noticeId }"> <div class="field-note" data-bind="attr: { id: element.noticeId }">
<span data-bind="text: element.notice"></span> <span data-bind="text: element.notice"></span>
</div> </div>
<!-- /ko --> <!-- /ko -->
<!-- ko if: element.error() --> <!-- ko if: element.error() -->
<div class="field-error" data-bind="attr: { id: element.errorId }" generated="true"> <div class="field-error" data-bind="attr: { id: element.errorId }" generated="true">
<span data-bind="text: element.error"></span> <span data-bind="text: element.error"></span>
</div> </div>
<!-- /ko --> <!-- /ko -->
<!-- ko if: element.warn() --> <!-- ko if: element.warn() -->
<div role="alert" class="message warning" data-bind="attr: { id: element.warningId }" generated="true"> <div role="alert" class="message warning" data-bind="attr: { id: element.warningId }" generated="true">
<span data-bind="text: element.warn"></span> <span data-bind="text: element.warn"></span>
</div> </div>
<!-- /ko --> <!-- /ko -->
</div> </div>
</div> </div>
...@@ -57,10 +57,16 @@ ...@@ -57,10 +57,16 @@
<!-- ko if: isCheckoutIndex() --> <!-- ko if: isCheckoutIndex() -->
<div class="field" data-bind="visible: visible, attr: {'name': element.dataScope}, css: additionalClasses"> <div class="field" data-bind="visible: visible, attr: {'name': element.dataScope}, css: additionalClasses">
<!-- ko if: isSelectIndex() -->
<label class="label" data-bind="attr: { for: element.uid },css: {'fouse-label':true}">
<!-- ko if: element.label --><span translate="element.label"></span><!-- /ko -->
</label>
<!-- /ko -->
<!-- ko ifnot: isSelectIndex() -->
<label class="label" data-bind="attr: { for: element.uid },css: {'fouse-label': element.value}"> <label class="label" data-bind="attr: { for: element.uid },css: {'fouse-label': element.value}">
<!-- ko if: element.label --><span translate="element.label"></span><!-- /ko --> <!-- ko if: element.label --><span translate="element.label"></span><!-- /ko -->
</label> </label>
<!-- /ko -->
<div class="control" data-bind="css: {'_with-tooltip': element.tooltip}"> <div class="control" data-bind="css: {'_with-tooltip': element.tooltip}">
<!-- ko ifnot: element.hasAddons() --> <!-- ko ifnot: element.hasAddons() -->
<!-- ko template: element.elementTmpl --><!-- /ko --> <!-- ko template: element.elementTmpl --><!-- /ko -->
......
<?php
namespace Magepow\Sizechart\Api\Data;
interface SizechartInterface
{
const ENTITY_ID = 'entity_id';
const CATEGORY_ID = 'category_id';
const SUB_CATEGORY_ID = 'sub_category_id';
const TYPE_DISPLAY = 'type_display';
const IS_ACTIVE = 'is_active';
const DESCRIPTION = 'description';
const SIZECHART_INFO = 'sizechart_info';
const UPDATED_AT = 'updated_at';
const CREATED_AT = 'created_at';
const TEMPLATE_CSS = 'template_css';
const CONDITIONS = 'conditions_serialized';
const STORE = 'stores';
public function getEntityId();
public function setEntityId($entityId);
public function getCategoryId();
public function setCategoryId($categoryId);
public function getSubCategoryId();
public function setSubCategoryId($subCategoryId);
public function getIsActive();
public function setIsActive($isActive);
public function getTypeDisplay();
public function setTypeDisplay($typeDisplay);
public function getDescription();
public function setDescription($description);
public function getSizeChartInfo();
public function setSizeChartInfo($sizeChartInfo);
public function getUpdatedAt();
public function setUpdatedAt($updatedAt);
public function getCreatedAt();
public function setCreatedAt($createdAt);
public function getTemplateCss();
public function setTemplateCss($templateCss);
public function getConditions();
public function setConditions($conditions);
public function getStoreView();
public function setStoreView($stores);
}
\ No newline at end of file
<?php
namespace Magepow\Sizechart\Block\Adminhtml\Sizechart;
class AddRow extends \Magento\Backend\Block\Widget\Form\Container
{
protected $_coreRegistry = null;
public function __construct(
\Magento\Backend\Block\Widget\Context $context,
\Magento\Framework\Registry $registry,
array $data = []
) {
$this->_coreRegistry = $registry;
parent::__construct($context, $data);
}
protected function _construct()
{
$this->_objectId = 'row_id';
$this->_blockGroup = 'Magepow_Sizechart';
$this->_controller = 'adminhtml_sizechart';
parent::_construct();
if ($this->_isAllowedAction('Magepow_Sizechart::add_row')) {
$this->buttonList->update('save', 'label', __('Save'));
$this->buttonList->add(
'saveandcontinue',
[
'label' => __('Save and Continue Edit'),
'class' => 'save',
'data_attribute' => [
'mage-init' => [
'button' => [
'event' => 'saveAndContinueEdit',
'target' => '#edit_form'
]
]
]
]
);
} else {
$this->buttonList->remove('save');
}
// $this->buttonList->remove('reset');
}
public function getHeaderText()
{
return __('Add Size Chart Rule');
}
protected function _isAllowedAction($resourceId)
{
return $this->_authorization->isAllowed($resourceId);
}
public function getFormActionUrl()
{
if ($this->hasFormActionUrl()) {
return $this->getData('form_action_url');
}
return $this->getUrl('*/*/save');
}
}
\ No newline at end of file
<?php
namespace Magepow\Sizechart\Block\Adminhtml\Sizechart;
use Joshine\Review\Model\Repository\VoteRepository;
use Magento\Framework\View\Element\Template;
use Magepow\Sizechart\Model\SizechartFactory;
class ChartTable extends Template
{
protected $_template = 'Magepow_Sizechart::chartTable.phtml';
/**
* @var SizechartFactory
*/
private $chartFactory;
public function __construct(
Template\Context $context,
SizechartFactory $chartFactory,
array $data = []
) {
$this->chartFactory = $chartFactory;
parent::__construct($context, $data);
}
public function getCustomSizeData()
{
$id = $this->getRequest()->getParam('id');
if (!$id) {
return [];
}
return $this->chartFactory->create()->load($id);
}
}
\ No newline at end of file
<?php
namespace Magepow\Sizechart\Block\Adminhtml\Sizechart;
use Magento\Framework\View\Element\Template;
use Magepow\Sizechart\Model\SizechartFactory;
class ColumLabel extends Template
{
protected $_template = 'Magepow_Sizechart::columnLabel.phtml';
/**
* @var SizechartFactory
*/
private $chartFactory;
public function __construct(
Template\Context $context,
SizechartFactory $chartFactory,
array $data = []
) {
$this->chartFactory = $chartFactory;
parent::__construct($context, $data);
}
public function getCustomSizeData()
{
$id = $this->getRequest()->getParam('id');
if (!$id) {
return [];
}
return $this->chartFactory->create()->load($id);
}
}
\ No newline at end of file
<?php
namespace Magepow\Sizechart\Block\Adminhtml\Sizechart\Edit;
class Form extends \Magento\Backend\Block\Widget\Form\Generic
{
/**
* Prepare form.
*
* @return $this
*/
protected function _prepareForm()
{
$dateFormat = $this->_localeDate->getDateFormat(\IntlDateFormatter::SHORT);
$model = $this->_coreRegistry->registry('row_data');
$form = $this->_formFactory->create(
[
'data' => [
'id' => 'edit_form',
'enctype' => 'multipart/form-data',
'action' => $this->getData('action'),
'method' => 'post'
]
]
);
$form->setValues($model->getData());
$form->setUseContainer(true);
$this->setForm($form);
return parent::_prepareForm();
}
}
\ No newline at end of file
<?php
namespace Magepow\Sizechart\Block\Adminhtml\Sizechart\Edit\Tab;
use Magento\Backend\Block\Widget\Form\Generic;
use Magento\Backend\Block\Widget\Tab\TabInterface;
class Condition extends Generic implements TabInterface
{
protected $_renderFieldSet;
protected $_conditions;
protected $_ruleFactory;
public function __construct(
\Magento\Backend\Block\Template\Context $context,
\Magento\Framework\Registry $registry,
\Magento\Framework\Data\FormFactory $formFactory,
\Magento\Store\Model\System\Store $systemStore,
\Magento\Framework\ObjectManagerInterface $objectManager,
\Magento\Rule\Block\Conditions $conditions,
\Magento\CatalogWidget\Model\RuleFactory $ruleFactory,
\Magento\Backend\Block\Widget\Form\Renderer\Fieldset $rendererFieldset,
array $data = []
) {
$this->_conditions = $conditions;
$this->_ruleFactory = $ruleFactory;
$this->_renderFieldSet = $rendererFieldset;
parent::__construct($context, $registry, $formFactory, $data);
}
protected function _prepareForm()
{
$model = $this->_coreRegistry->registry('row_data');
$form = $this->_formFactory->create();
$form->setHtmlIdPrefix('wkgrid_');
$fieldsetId = 'conditions_fieldset';
$formName = 'catalog_rule_form';
$widgetParameters = $model->getParameters();
$modelConditions = $this->_ruleFactory->create();
if (is_array($widgetParameters)) {
$modelConditions->loadPost($widgetParameters);
$modelConditions->getConditions()->setJsFormObject($fieldsetId);
}
$newChildUrl = $this->getUrl(
'catalog_rule/promo_catalog/newConditionHtml/form/' . $fieldsetId,
['form_namespace' => $fieldsetId]
);
$renderer = $this->_renderFieldSet->setTemplate('Magento_CatalogRule::promo/fieldset.phtml')
->setNewChildUrl($newChildUrl)
->setFieldSetId($fieldsetId);
$fieldset = $form->addFieldset(
$fieldsetId,
['legend' => __('Conditions (don\'t add conditions if rule is applied to all products)')]
)->setRenderer($renderer);
$fieldset->addField(
'conditions',
'text',
[
'name' => 'conditions',
'label' => __('Conditions'),
'title' => __('Conditions'),
'required' => false,
'data-form-parts' => $formName
]
)->setRule($modelConditions)->setRenderer($this->_conditions);
$form->setValues($model->getData());
$this->setForm($form);
return parent::_prepareForm();
}
public function getTabLabel()
{
return __('Condition apply for products');
}
public function getTabTitle()
{
return __('Condition apply for products');
}
/**
* Can show tab in tabs
*
* @return boolean
* @api
*/
public function canShowTab()
{
return true;
}
/**
* Tab is hidden
*
* @return boolean
* @api
*/
public function isHidden()
{
return false;
}
}
\ No newline at end of file
<?php
namespace Magepow\Sizechart\Block\Adminhtml\Sizechart\Edit\Tab;
use Magento\Backend\Block\Widget\Form\Generic;
use Magento\Backend\Block\Widget\Tab\TabInterface;
use Magepow\Sizechart\Block\Adminhtml\Sizechart\ChartTable;
use Magepow\Sizechart\Block\Adminhtml\Sizechart\CustomerSize;
use Magepow\Sizechart\Block\Adminhtml\Sizechart\Field\FieldChartTable;
use Magepow\Sizechart\Block\Adminhtml\Sizechart\Field\FieldColumnLabel;
class Main extends Generic implements TabInterface
{
protected $_systemStore;
protected $_objectManager;
public function __construct(
\Magento\Backend\Block\Template\Context $context,
\Magento\Framework\Registry $registry,
\Magento\Cms\Model\Wysiwyg\Config $wysiwygConfig,
\Magento\Framework\Data\FormFactory $formFactory,
\Magento\Framework\ObjectManagerInterface $objectManager,
\Magepow\Sizechart\Model\Status $options,
\Magento\Store\Model\System\Store $systemStore,
\Magepow\Sizechart\Model\TypeDisplay $typeDisplay,
array $data = []
) {
$this->_systemStore = $systemStore;
$this->_options = $options;
$this->_wysiwygConfig = $wysiwygConfig;
$this->_typeDisplay = $typeDisplay;
$this->_systemStore = $systemStore;
$this->_objectManager = $context->getStoreManager();
parent::__construct($context, $registry, $formFactory, $data);
}
protected function _prepareForm()
{
$dateFormat = $this->_localeDate->getDateFormat(\IntlDateFormatter::SHORT);
$model = $this->_coreRegistry->registry('row_data');
$form = $this->_formFactory->create();
$form->setHtmlIdPrefix('wkgrid_');
if ($model->getEntityId()) {
$fieldset = $form->addFieldset(
'base_fieldset',
['legend' => __('Edit Size Chart Rule'), 'class' => 'fieldset-wide']
);
// $fieldset->addField('entity_id', 'hidden', ['name' => 'entity_id']); // not use will conflict entity_id ofcondition product
$fieldset->addField('sizechart_id', 'hidden', ['name' => 'sizechart_id']);
} else {
$fieldset = $form->addFieldset(
'base_fieldset',
['legend' => __('Add Size Chart Rule'), 'class' => 'fieldset-wide']
);
}
$fieldset->addField(
'name',
'text',
[
'name' => 'name',
'label' => __('Name'),
'id' => 'name',
'title' => __('Name'),
'class' => 'required_entry',
'required' => true,
]
);
if (!$this->_storeManager->isSingleStoreMode()) {
$field = $fieldset->addField(
'stores',
'multiselect',
[
'name' => 'stores[]',
'label' => __('Store View'),
'title' => __('Store View'),
'required' => true,
'values' => $this->_systemStore->getStoreValuesForForm(false, true)
]
);
$renderer = $this->getLayout()->createBlock(
'Magento\Backend\Block\Store\Switcher\Form\Renderer\Fieldset\Element'
);
$field->setRenderer($renderer);
} else {
$fieldset->addField(
'stores',
'hidden',
['name' => 'stores[]', 'value' => $this->_storeManager->getStore(true)->getId()]
);
$model->setStoreId($this->_storeManager->getStore(true)->getId());
}
$fieldset->addField(
'description',
'textarea',
[
'name' => 'description',
'label' => __('Description'),
'id' => 'description',
'title' => __('Description'),
'style' => 'height:10em',
'required' => false,
]
);
$wysiwygConfig = $this->_wysiwygConfig->getConfig(['tab_id' => $this->getTabId()]);
$fieldset->addField(
'sizechart_info',
'editor',
[
'name' => 'sizechart_info',
'label' => __('Size Chart Information'),
'wysiwyg' => true,
'required' => true,
'config' => $wysiwygConfig
]
);
$fieldset->addType(
'column_label',
FieldColumnLabel::class
);
$fieldset->addType(
'chart_table',
FieldChartTable::class
);
$fieldset->addField(
'column_label',
'column_label',
[
'name' => 'column_label',
'label' => __('Column Label'),
'id' => 'column_label',
'title' => __('Column Label'),
'required' => true,
]
);
$fieldset->addField(
'chart_table',
'chart_table',
[
'name' => 'chart_table',
'label' => __('Chart Table(英尺)'),
'id' => 'chart_table',
'title' => __('Chart Table'),
'required' => false,
]
);
$fieldset->addField(
'category',
'text',
[
'name' => 'category',
'label' => __('分类ID(多个用,隔开不要空格)'),
'id' => 'category',
'title' => __('分类ID(多个用,隔开不要空格)'),
'required' => false,
]
);
$fieldset->addField(
'type_display',
'hidden',
[
'name' => 'type_display',
'label' => __('Type Display'),
'id' => 'type_display',
'title' => __('Type Display'),
'value' => 1,
'required' => false,
]
);
$fieldset->addField(
'is_active',
'select',
[
'name' => 'is_active',
'label' => __('Status'),
'id' => 'is_active',
'title' => __('Status'),
'values' => $this->_options->getOptionArray(),
'value' => 1,
'required' => true,
]
);
$form->addValues($model->getData());
$this->setForm($form);
return parent::_prepareForm();
}
public function getTabLabel()
{
return __('General Information');
}
public function getTabTitle()
{
return __('General Information');
}
/**
* Can show tab in tabs
*
* @return boolean
* @api
*/
public function canShowTab()
{
return true;
}
/**
* Tab is hidden
*
* @return boolean
* @api
*/
public function isHidden()
{
return false;
}
}
\ No newline at end of file
<?php
namespace Magepow\Sizechart\Block\Adminhtml\Sizechart\Edit;
use Magento\Backend\Block\Widget\Tabs as WidgetTabs;
class Tabs extends WidgetTabs
{
/**
* Class constructor
*
* @return void
*/
protected function _construct()
{
parent::_construct();
$this->setId('sizechart_tabs');
$this->setDestElementId('edit_form');
$this->setTitle(__('Size Chart Information'));
}
/**
* @return $this
*/
protected function _beforeToHtml()
{
$this->addTab(
'main_section',
[
'label' => __('General Information'),
'title' => __('General Information'),
'content' => $this->getLayout()->createBlock(
'Magepow\Sizechart\Block\Adminhtml\Sizechart\Edit\Tab\Main'
)->toHtml(),
]
);
/* $this->addTab(
'category',
[
'label' => __('Condition apply for products'),
'title' => __('Condition apply for products'),
'content' => $this->getLayout()->createBlock(
'Magepow\Sizechart\Block\Adminhtml\Sizechart\Edit\Tab\Condition'
)->toHtml(),
]
);*/
return parent::_beforeToHtml();
}
}
\ No newline at end of file
<?php
namespace Magepow\Sizechart\Block\Adminhtml\Sizechart\Field;
use Magento\Framework\Escaper;
use Magepow\Sizechart\Block\Adminhtml\Sizechart\ChartTable;
class FieldChartTable extends \Magento\Framework\Data\Form\Element\AbstractElement
{
protected $_blockFactory;
public function __construct(
\Magento\Framework\Data\Form\Element\Factory $factoryElement,
\Magento\Framework\Data\Form\Element\CollectionFactory $factoryCollection,
Escaper $escaper,
\Magento\Framework\View\Element\BlockFactory $_blockFactory,
$data = []
) {
$this->_blockFactory = $_blockFactory;
parent::__construct($factoryElement, $factoryCollection, $escaper, $data);
}
/**
* Get the after element html.
*
* @return mixed
*/
public function getElementHtml() {
$customDiv = $this->_blockFactory
->createBlock(ChartTable::class)
->toHtml();
return $customDiv;
}
}
\ No newline at end of file
<?php
namespace Magepow\Sizechart\Block\Adminhtml\Sizechart\Field;
use Magento\Framework\Escaper;
use Magepow\Sizechart\Block\Adminhtml\Sizechart\ChartTable;
use Magepow\Sizechart\Block\Adminhtml\Sizechart\ColumLabel;
class FieldColumnLabel extends \Magento\Framework\Data\Form\Element\AbstractElement
{
protected $_blockFactory;
public function __construct(
\Magento\Framework\Data\Form\Element\Factory $factoryElement,
\Magento\Framework\Data\Form\Element\CollectionFactory $factoryCollection,
Escaper $escaper,
\Magento\Framework\View\Element\BlockFactory $_blockFactory,
$data = []
) {
$this->_blockFactory = $_blockFactory;
parent::__construct($factoryElement, $factoryCollection, $escaper, $data);
}
/**
* Get the after element html.
*
* @return mixed
*/
public function getElementHtml() {
$customDiv = $this->_blockFactory
->createBlock(ColumLabel::class)
->toHtml();
return $customDiv;
}
}
\ No newline at end of file
<?php
namespace Magepow\Sizechart\Block\Product;
use Magento\Store\Model\ScopeInterface;
class Sizechart extends \Magento\Catalog\Block\Product\AbstractProduct
{
/**
* Product collection factory
*
* @var \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory
*/
protected $_ruleFactory;
/**
* Product collection factory
*
* @var \Magiccart\Magicproduct\Model\Magicproduct
*/
protected $_sizechartFactory;
protected $_limit; // Limit Product
protected $_parameters; // Condition Product
protected $_request;
protected $_abstractProduct;
protected $json;
protected $_filter;
/**
* @param Context $context
* @param \Magento\Framework\ObjectManagerInterface $objectManager
* @param \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory $productCollectionFactory
* @param \Magento\Catalog\Model\Product\Visibility $catalogProductVisibility
* @param array $data
*/
public function __construct(
\Magento\Catalog\Block\Product\Context $context,
\Magento\CatalogWidget\Model\RuleFactory $ruleFactory,
\Magepow\Sizechart\Model\SizechartFactory $sizechartFactory,
\Magepow\Sizechart\Serialize\Serializer\Json $json,
\Magento\Cms\Model\Template\FilterProvider $filter,
array $data = []
) {
$this->_ruleFactory = $ruleFactory;
$this->_filter = $filter;
$this->json = $json;
$this->_sizechartFactory = $sizechartFactory;
parent::__construct($context, $data);
}
public function getSizeChartCollection()
{
$store = $this->_storeManager->getStore()->getStoreId();;
$collection = $this->_sizechartFactory->create()->getCollection()
->addFieldToSelect('*')
->addFieldToFilter('is_active', 1)
->addFieldToFilter('stores', array(array('finset' => 0), array('finset' => $store)))
->setOrder('sort_order', 'ASC');
return $collection;
}
public function getSizeChart()
{
if (!$this->hasData('size_chart')) {
$collection = $this->getSizeChartCollection();
$product = $this->getProduct();
$sizeChart = '';
foreach ($collection as $item) {
//$config = $item->getConditionsSerialized();
//$data = $this->json->unserialize($config);
//$parameters = $data['parameters'];
//$rule = $this->getRule($parameters);
//$validate = $rule->getConditions()->validate($product);
/* if ($validate) {
$sizeChart = $item;
break;
}*/
$category = $item->getCategory();
if (empty($category)) {
continue;
}
$categoryIds = explode(',',$category);
$pids = $product->getCategoryIds();
if (count(array_intersect($categoryIds, $pids)) > 0 ) {
$sizeChart = $item;
break;
}
}
$this->setData('size_chart', $sizeChart);
}
return $this->getData('size_chart');
}
public function getContentFromStaticBlock($content)
{
return $this->_filter->getBlockFilter()->filter($content);
}
public function getClass($typeDisplay)
{
$type = 'sizechart-customtab';
if ($typeDisplay == 1) {
$type = 'sizechart-inline';
} elseif ($typeDisplay == 2) {
$type = 'sizechart-popup';
}
return $type;
}
protected function getRule($conditions)
{
$rule = $this->_ruleFactory->create();
if (is_array($conditions)) $rule->loadPost($conditions);
return $rule;
}
public function getMedia($img = null)
{
$urlMedia = $this->_storeManager->getStore()->getBaseUrl(\Magento\Framework\UrlInterface::URL_TYPE_MEDIA);
if ($img) return $urlMedia . "magepow/sizechart/" . $img;
return $urlMedia;
}
public function isEnabled()
{
return $this->_scopeConfig
->getValue(
'magepow_sizechart/general/enabled',
ScopeInterface::SCOPE_STORE
);
}
static public function getChartJson()
{
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$chartBlock = $objectManager->create(\Magepow\Sizechart\Block\Product\Sizechart::class);
$sizeChart = $chartBlock->getSizeChart();
$chartTableArray = [];
if ($sizeChart != null) {
$chartTable = $sizeChart->getData('custom_size');
$chartTableArray = $chartTable;
}
return json_encode($chartTableArray, true);
}
}
\ No newline at end of file
<?php
namespace Magepow\Sizechart\Controller\Adminhtml;
abstract class Action extends \Magento\Backend\App\Action
{
/**
* Core registry
*
* @var \Magento\Framework\Registry
*/
protected $coreRegistry = null;
/**
* @var \Magento\Framework\App\Response\Http\FileFactory
*/
protected $fileFactory;
/**
* @var \Magento\Framework\Stdlib\DateTime\Filter\Date
*/
protected $dateFilter;
protected $_sizechartFactory;
/**
* @var \Psr\Log\LoggerInterface
*/
protected $logger;
/**
* @param \Magento\Backend\App\Action\Context $context
* @param \Magento\Framework\Registry $coreRegistry
* @param \Magento\Framework\App\Response\Http\FileFactory $fileFactory
* @param \Magento\Framework\Stdlib\DateTime\Filter\Date $dateFilter
* @param \Psr\Log\LoggerInterface $logger
*/
public function __construct(
\Magento\Backend\App\Action\Context $context,
\Magento\Framework\Registry $coreRegistry,
\Magento\Framework\App\Response\Http\FileFactory $fileFactory,
\Magento\Framework\Stdlib\DateTime\Filter\Date $dateFilter,
\Magepow\Sizechart\Model\SizechartFactory $sizechartFactory,
\Psr\Log\LoggerInterface $logger
) {
parent::__construct($context);
$this->coreRegistry = $coreRegistry;
$this->fileFactory = $fileFactory;
$this->dateFilter = $dateFilter;
$this->_sizechartFactory = $sizechartFactory;
$this->logger = $logger;
}
/**
* Initiate rule
*
* @return void
*/
protected function _initRule()
{
$rule = $this->_sizechartFactory->create();
$id = (int)$this->getRequest()->getParam('id');
if (!$id && $this->getRequest()->getParam('entity_id')) {
$id = (int)$this->getRequest()->getParam('entity_id');
}
}
protected function _initAction()
{
$this->_view->loadLayout();
$this->_setActiveMenu('Magepow_Sizechart::magepow_sizechart')
->_addBreadcrumb(__('Magepow Sizechart'), __('Magepow Sizechart'));
return $this;
}
/**
* Returns result of current user permission check on resource and privilege
*
* @return bool
*/
protected function _isAllowed()
{
return $this->_authorization->isAllowed('Magepow_Sizechart::sizechart');
}
}
\ No newline at end of file
<?php
namespace Magepow\Sizechart\Controller\Adminhtml\Sizechart;
use Magento\Framework\Controller\ResultFactory;
class AddRow extends \Magento\Backend\App\Action
{
private $coreRegistry;
private $sizechartFactory;
protected $json;
public function __construct(
\Magento\Backend\App\Action\Context $context,
\Magento\Framework\Registry $coreRegistry,
\Magepow\Sizechart\Model\SizechartFactory $sizechartFactory,
\Magepow\Sizechart\Serialize\Serializer\Json $json
) {
parent::__construct($context);
$this->coreRegistry = $coreRegistry;
$this->sizechartFactory = $sizechartFactory;
$this->json = $json;
}
public function execute()
{
$rowId = (int) $this->getRequest()->getParam('id');
$storeViewId = $this->getRequest()->getParam('stores');
$rowData = $this->sizechartFactory->create();
if ($rowId) {
// $rowData->setStoreViewId($storeViewId)->load($rowId);
$rowData = $rowData->setStoreViewId($storeViewId)->load($rowId);
$rowTitle = $rowData->getTitle();
if (!$rowData->getEntityId()) {
$this->messageManager->addError(__('row data no longer exist.'));
$this->_redirect('magepow_sizechart/sizechart/rowdata');
return;
} else {
//$tmp = $this->json->unserialize($rowData->getConditionsSerialized());
$tmp = $this->json->unserialize('{}');
if (is_array($tmp)) {
unset($tmp['form_key']);
unset($tmp['entity_id']);
$rowData->addData($tmp);
}
$rowData->setData('sizechart_id', $rowData->getEntityId()); // fix conflict entity_id in product condition
}
}
$this->coreRegistry->register('row_data', $rowData);
$resultPage = $this->resultFactory->create(ResultFactory::TYPE_PAGE);
$title = $rowId ? __('Edit Size chart') . $rowTitle : __('Add Size chart');
$resultPage->getConfig()->getTitle()->prepend($title);
return $resultPage;
}
}
\ No newline at end of file
<?php
namespace Magepow\Sizechart\Controller\Adminhtml\Sizechart;
class Index extends \Magento\Backend\App\Action
{
protected $resultPageFactory = false;
public function __construct(
\Magento\Backend\App\Action\Context $context,
\Magento\Framework\View\Result\PageFactory $resultPageFactory
) {
parent::__construct($context);
$this->resultPageFactory = $resultPageFactory;
}
public function execute()
{
$resultPage = $this->resultPageFactory->create();
$resultPage->getConfig()->getTitle()->prepend((__('Size Chart')));
return $resultPage;
}
}
\ No newline at end of file
<?php
namespace Magepow\Sizechart\Controller\Adminhtml\Sizechart;
use Magento\Framework\Controller\ResultFactory;
use Magento\Backend\App\Action\Context;
use Magento\Ui\Component\MassAction\Filter;
use Magepow\Sizechart\Model\ResourceModel\Sizechart\CollectionFactory;
class MassDelete extends \Magento\Backend\App\Action
{
/**
* Massactions filter.
* @var Filter
*/
protected $_filter;
/**
* @var CollectionFactory
*/
protected $_collectionFactory;
public function __construct(
Context $context,
Filter $filter,
CollectionFactory $collectionFactory
) {
$this->_filter = $filter;
$this->_collectionFactory = $collectionFactory;
parent::__construct($context);
}
public function execute()
{
$collection = $this->_filter->getCollection($this->_collectionFactory->create());
$recordDeleted = 0;
foreach ($collection->getItems() as $record) {
$record->setId($record->getEntityId());
$record->delete();
$recordDeleted++;
}
$this->messageManager->addSuccess(__(
'A total of %1 record(s) have been deleted.',
$recordDeleted
));
return $this->resultFactory->create(ResultFactory::TYPE_REDIRECT)->setPath('*/*/index');
}
protected function _isAllowed()
{
return $this->_authorization->isAllowed('Magepow_Sizechart::row_data_delete');
}
}
\ No newline at end of file
<?php
namespace Magepow\Sizechart\Controller\Adminhtml\Sizechart;
class Save extends \Magento\Backend\App\Action
{
protected $_sizechartFactory;
public function __construct(
\Magento\Backend\App\Action\Context $context,
\Magepow\Sizechart\Model\SizechartFactory $sizechartFactory
) {
parent::__construct($context);
$this->_sizechartFactory = $sizechartFactory;
}
public function serialize($data)
{
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$serializer = $objectManager->create(\Magento\Framework\Serialize\SerializerInterface::class);
return $serializer->serialize($data);
}
public function execute()
{
$resultRedirect = $this->resultRedirectFactory->create();
// check if data sent
$data = $this->getRequest()->getPostValue();
if ($data) {
$id = $this->getRequest()->getParam('sizechart_id');
if ($id) $data['entity_id'] = $id; // fix conflict entity_id in product condition
$model = $this->_sizechartFactory->create();
$storeViewId = $this->getRequest()->getParam('stores');
$model->load($id);
if (!$model->getId() && $id) {
$this->messageManager->addError(__('This item no longer exists.'));
return $resultRedirect->setPath('*/*/');
}
//$data['conditions_serialized'] = $this->serialize(['parameters' => $data['parameters']]);
if (isset($data['custom_size'])) {
$data['custom_size'] = json_encode($data['custom_size'], true);
}
if (isset($data['stores'])) $data['stores'] = implode(',', $data['stores']);
$model->setData($data)->setStoreViewId($storeViewId);;
// try to save it
try {
$model->save();
// display success message
$this->messageManager->addSuccess(__('You saved the item.'));
if ($this->getRequest()->getParam('back')) {
$this->_redirect('*/*/addrow', ['id' => $model->getId(), '_current' => true]);
return;
}
// go to grid
return $resultRedirect->setPath('*/*/index');
} catch (\Exception $e) {
// display error message
$this->messageManager->addError($e->getMessage());
// save data in session
$this->_objectManager->get('Magento\Backend\Model\Session')->setFormData($data);
// redirect to edit form
return $resultRedirect->setPath('*/*/addrow', ['id' => $this->getRequest()->getParam('id')]);
}
}
return $resultRedirect->setPath('*/*/index');
}
}
\ No newline at end of file
<?php
namespace Magepow\Sizechart\Controller\Index;
class Index extends \Magento\Framework\App\Action\Action
{
protected $_pageFactory;
protected $_sizechartFactory;
public function __construct(
\Magento\Framework\App\Action\Context $context,
\Magento\Framework\View\Result\PageFactory $pageFactory,
\Magepow\Sizechart\Model\SizechartFactory $sizechartFactory
) {
$this->_pageFactory = $pageFactory;
$this->_sizechartFactory = $sizechartFactory;
return parent::__construct($context);
}
public function execute()
{
$page = $this->_pageFactory->create();
$pageFactory = $page->getLayout()->getBlock('Magepow\Sizechart\Block\Product\Sizechart');
//We are using HTTP headers to control various page caches (varnish, fastly, built-in php cache)
$pageFactory->setHeader('Cache-Control', 'no-store, no-cache, must-revalidate, max-age=0', true);
return $pageFactory;
}
}
\ No newline at end of file
<?php
namespace Magepow\Sizechart\Helper;
class Cache extends \Magento\Framework\App\Helper\AbstractHelper
{
protected $cacheTypeList;
protected $cacheFrontendPool;
/**
* Cache constructor.
* @param \Magento\Framework\App\Helper\Context $context
* @param \Magento\Framework\App\Cache\TypeListInterface $cacheTypeList
* @param \Magento\Framework\App\Cache\Frontend\Pool $cacheFrontendPool
*/
public function __construct(
\Magento\Framework\App\Helper\Context $context,
\Magento\Framework\App\Cache\TypeListInterface $cacheTypeList,
\Magento\Framework\App\Cache\Frontend\Pool $cacheFrontendPool
) {
parent::__construct($context);
$this->cacheTypeList = $cacheTypeList;
$this->cacheFrontendPool = $cacheFrontendPool;
}
/**
*
* Flush Cache Action
*
*/
public function flushCache()
{
$types = [
'config',
'layout',
'block_html',
'collections',
'reflection',
'db_ddl',
'eav',
'config_integration',
'config_integration_api',
'full_page',
'translate',
'config_webservice'
];
foreach ($types as $type) {
$this->cacheTypeList->cleanType($type);
}
foreach ($this->cacheFrontendPool as $cacheFrontend) {
$cacheFrontend->getBackend()->clean();
}
}
}
\ No newline at end of file
<?php
namespace Magepow\Sizechart\Helper;
use Magento\Framework\App\Helper\AbstractHelper;
use Magento\Store\Model\ScopeInterface;
class Data extends AbstractHelper
{
protected $configModule;
protected $_moduleManager;
public function __construct(
\Magento\Framework\App\Helper\Context $context,
\Magento\Framework\Module\Manager $moduleManager
) {
parent::__construct($context);
$this->configModule = $this->getConfig(strtolower($this->_getModuleName()));
$this->_moduleManager = $moduleManager;
}
public function getConfig($cfg = '')
{
if ($cfg) return $this->scopeConfig->getValue($cfg, \Magento\Store\Model\ScopeInterface::SCOPE_STORE);
return $this->scopeConfig;
}
public function getConfigModule($cfg = '', $value = null)
{
$values = $this->configModule;
if (!$cfg) return $values;
$config = explode('/', (string) $cfg);
$end = count($config) - 1;
foreach ($config as $key => $vl) {
if (isset($values[$vl])) {
if ($key == $end) {
$value = $values[$vl];
} else {
$values = $values[$vl];
}
}
}
return $value;
}
public function isModuleEnabled($moduleName)
{
return $this->_moduleManager->isEnabled($moduleName);
}
}
\ No newline at end of file
<?php
namespace Magepow\Sizechart\Model;
use Magento\Backend\App\Action\Context;
use Magento\Backend\App\Action;
use Magento\Framework\App\Cache\Manager as CacheManager;
use Magento\Framework\App\Cache\TypeListInterface as CacheTypeListInterface;
class Cron
{
public function __construct(
\Magento\Framework\Model\Context $context,
\Magento\Framework\App\Cache\TypeListInterface $cacheTypeList,
\Magento\Framework\App\Cache\Frontend\Pool $cacheFrontendPool
) {
$this->_cacheTypeList = $cacheTypeList;
$this->_cacheFrontendPool = $cacheFrontendPool;
}
public function flushCache()
{
$types = [
'config',
'layout',
'block_html',
'collections',
'reflection',
'db_ddl',
'eav',
'config_integration',
'config_integration_api',
'full_page',
'translate',
'config_webservice'
];
foreach ($types as $type) {
$this->cacheTypeList->cleanType($type);
}
foreach ($this->cacheFrontendPool as $cacheFrontend) {
$cacheFrontend->getBackend()->clean();
}
}
}
\ No newline at end of file
<?php
namespace Magepow\Sizechart\Model\ResourceModel;
class Sizechart extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb
{
public function __construct(
\Magento\Framework\Model\ResourceModel\Db\Context $context
) {
parent::__construct($context);
}
protected function _construct()
{
$this->_init('sizechart_management', 'entity_id');
}
}
\ No newline at end of file
<?php
namespace Magepow\Sizechart\Model\ResourceModel\Sizechart;
class Collection extends \Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection
{
protected $_idFieldName = 'entity_id';
/**
* Define resource model
*
* @return void
*/
protected function _construct()
{
$this->_init(
'Magepow\Sizechart\Model\Sizechart',
'Magepow\Sizechart\Model\ResourceModel\Sizechart'
);
}
}
\ No newline at end of file
<?php
namespace Magepow\Sizechart\Model;
use Magepow\Sizechart\Api\Data\SizechartInterface;
class Sizechart extends \Magento\Framework\Model\AbstractModel implements SizechartInterface
{
const CACHE_TAG = 'sizechart_management';
protected $_cacheTag = 'sizechart_management';
protected $_eventPrefix = 'sizechart_management';
protected function _construct()
{
$this->_init('Magepow\Sizechart\Model\ResourceModel\Sizechart');
}
public function getIdentities()
{
return [self::CACHE_TAG . '_' . $this->getId()];
}
public function getDefaultValues()
{
$values = [];
return $values;
}
public function getEntityId()
{
return $this->getData(self::ENTITY_ID);
}
public function setEntityId($entityId)
{
return $this->setData(self::ENTITY_ID, $entityId);
}
public function getCategoryId()
{
return $this->getData(self::CATEGORY_ID);
}
public function setCategoryId($categoryId)
{
return $this->setData(self::CATEGORY_ID, $categoryId);
}
public function getSubCategoryId()
{
return $this->getData(self::SUB_CATEGORY_ID);
}
public function setSubCategoryId($subCategoryId)
{
return $this->setData(self::SUB_CATEGORY_ID, $subCategoryId);
}
public function getTypeDisplay()
{
return $this->getData(self::TYPE_DISPLAY);
}
public function setTypeDisplay($typeDisplay)
{
return $this->setData(self::TYPE_DISPLAY, $typeDisplay);
}
public function getDescription()
{
return $this->getData(self::DESCRIPTION);
}
public function setDescription($description)
{
return $this->setData(self::DESCRIPTION, $description);
}
public function getSizeChartInfo()
{
return $this->getData(self::SIZECHART_INFO);
}
public function setSizeChartInfo($sizeChartInfo)
{
return $this->setData(self::SIZECHART_INFO, $sizeChartInfo);
}
public function getUpdatedAt()
{
return $this->getData(self::UPDATED_AT);
}
public function setUpdatedAt($updatedAt)
{
return $this->setData(self::UPDATED_AT, $updatedAt);
}
public function getCreatedAt()
{
return $this->getData(self::CREATED_AT);
}
public function setCreatedAt($createdAt)
{
return $this->setData(self::CREATED_AT, $createdAt);
}
public function getIsActive()
{
return $this->getData(self::IS_ACTIVE);
}
public function setIsActive($isActive)
{
return $this->setData(self::IS_ACTIVE, $isActive);
}
public function getTemplateCss()
{
return $this->getData(self::TEMPLATE_CSS);
}
public function setTemplateCss($templateCss)
{
return $this->setData(self::TEMPLATE_CSS, $templateCss);
}
public function getConditions()
{
return $this->getData(self::CONDITIONS);
}
public function setConditions($conditions)
{
return $this->setData(self::CONDITIONS, $conditions);
}
public function getStoreView()
{
return $this->getData(self::STORES);
}
public function setStoreView($stores)
{
return $this->setData(self::STORES, $stores);
}
}
\ No newline at end of file
<?php
namespace Magepow\Sizechart\Model;
use Magento\Framework\Data\OptionSourceInterface;
class Status implements OptionSourceInterface
{
public function getOptionArray()
{
$options = ['1' => __('Enabled'), '0' => __('Disabled')];
return $options;
}
/**
* Get Grid row status labels array with empty value for option element.
*
* @return array
*/
public function getAllOptions()
{
$res = $this->getOptions();
array_unshift($res, ['value' => '', 'label' => '']);
return $res;
}
/**
* Get Grid row type array for option element.
* @return array
*/
public function getOptions()
{
$res = [];
foreach ($this->getOptionArray() as $index => $value) {
$res[] = ['value' => $index, 'label' => $value];
}
return $res;
}
/**
* {@inheritdoc}
*/
public function toOptionArray()
{
return $this->getOptions();
}
}
\ No newline at end of file
<?php
namespace Magepow\Sizechart\Model;
use Magento\Framework\Data\OptionSourceInterface;
class TypeDisplay implements OptionSourceInterface
{
public function getOptionArray()
{
$options = ['1' => __('Inline'), '2' => __('Pop Up'), '3' => __('Custom Tab')];
return $options;
}
/**
* Get Grid row status labels array with empty value for option element.
*
* @return array
*/
public function getAllOptions()
{
$res = $this->getOptions();
array_unshift($res, ['value' => '', 'label' => '']);
return $res;
}
/**
* Get Grid row type array for option element.
* @return array
*/
public function getOptions()
{
$res = [];
foreach ($this->getOptionArray() as $index => $value) {
$res[] = ['value' => $index, 'label' => $value];
}
return $res;
}
/**
* {@inheritdoc}
*/
public function toOptionArray()
{
return $this->getOptions();
}
}
\ No newline at end of file
[<img src="https://github.com/magepow/themeforest/blob/master/shopify/shopify_affiliate.jpg" >](https://shopify.pxf.io/VyL446)
## Magento 2 Size Chart
Magento 2 Sizechart is a module allows admin to show their size chart diagram below product images on product page which helps customers choose the most suitable size for them.
Displaying exact product sizes on the website makes it easy for customers to choose the right product for their needs.
Product size will vary depending on the brand, each country. Therefore, adding a product-specific size chart on your e-commerce website is essential.
### Benefits
- Create size chart according to product characteristics: clothes, shoes, electronic devices, furniture, accessories...
- Show size chart inline, custom tab, popup.
- Add linked text, images or labels.
- Save time for the project
- Apply precedence rule to size chart
- Manage size rules in the backend
- Avoid customers returning products due to size problems
- Works well on mobile devices
## How does Site Chart work for Magento
- Detail Description: [Magento 2 Size Chart](https://magepow.com/magento-2-size-chart.html)
- [DOCUMENTATION](https://docs.magepow.com/sizechart/)
[![Latest Stable Version](https://poser.pugx.org/magepow/sizechart/v/stable)](https://packagist.org/packages/magepow/sizechart)
[![Total Downloads](https://poser.pugx.org/magepow/sizechart/downloads)](https://packagist.org/packages/magepow/sizechart)
[![Daily Downloads](https://poser.pugx.org/magepow/sizechart/d/daily)](https://packagist.org/packages/magepow/sizechart)
## Download Magento 2 Sizechart Extension
### Install via composer (recommend)
Run the following commands in Magento 2 root folder:
```
composer require magepow/sizechart
php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy -f
```
## Step 2: How to use Magento 2 Sizechart?
### 1. General configuration
Login to magento admin, choose `stores->configuration->magepow->Sizechart`
![Image of magento admin config](https://github.com/magepow/magento2-sizechart/blob/master/media/config.png)
Select `yes` to enable the module
### 2. Details Configuration
In `stores->configuration->magepow->sizechart` we set:
* Display text link : Show text link if user sets popup for displaying size chart.
* Image icon : Select image icon (only using when user sets popup for displaying size chart)
![Image of magento backend](https://github.com/magepow/magento2-sizechart/blob/master/media/config-popup.png)
### 3. Add Sizechart
Choose `Magepow->Size chart Management->Add New Size Chart Rule`.
![Image of magento backend](https://github.com/magepow/magento2-sizechart/blob/master/media/add-content1.png)
![Image of magento backend](https://github.com/magepow/magento2-sizechart/blob/master/media/add-content2.png)
![Image of magento backend](https://github.com/magepow/magento2-sizechart/blob/master/media/add-content3.png)
* Name: Name of your size chart management rule
* Store View : Define which store view you wish to show
* Description : Introduce about your size chart
* Size chart Information : Details about your size chart : you can write your diagram, image as you want
* Sort order : This part is used for the priority. If there is any rule have the same information. then the one which lower number will have the higher priority.
* Type Display : You can choose 3 types of displaying included: Inline, Custom Tab, Popup.
* Status: Select Enable/Disable for turning on/off the size chart rule.
### 4. Edit Sizechart
![Image of magento backend](https://github.com/magepow/magento2-sizechart/blob/master/media/edit.png)
### 5. Delete Sizechart
![Image of magento backend](https://github.com/magepow/magento2-sizechart/blob/master/media/delete.png)
### 6. Product Rule
Choose `Magepow->Size chart Management->Add New Size Chart Rule` and set number for sort order
This part is used for the priority of size chart. The rule on this part will be prioritized to show. This is for prevent the conflict when multiple rule are applied on one product or rally of products.
Run the following command:
```
php bin/magento cache:clean
```
### 3. Result
![Image of magento store front](https://github.com/magepow/magento2-sizechart/blob/master/media/result.png)
## Donation
If this project help you reduce time to develop, you can give me a cup of coffee :)
[![paypal](https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif)](https://www.paypal.com/paypalme/alopay)
**[Our Magento 2 Extensions](https://magepow.com/magento-2-extensions.html)**
* [Magento 2 Recent Sales Notification](https://magepow.com/magento-2-recent-order-notification.html)
* [Magento 2 Categories Extension](https://magepow.com/magento-categories-extension.html)
* [Magento 2 Sticky Cart](https://magepow.com/magento-sticky-cart.html)
* [Magento 2 Ajax Contact](https://magepow.com/magento-ajax-contact-form.html)
* [Magento 2 Lazy Load](https://magepow.com/magento-lazy-load.html)
* [Magento 2 Mutil Translate](https://magepow.com/magento-multi-translate.html)
* [Magento 2 Instagram Integration](https://magepow.com/magento-2-instagram.html)
* [Magento 2 Lookbook Pin Products](https://magepow.com/lookbook-pin-products.html)
* [Magento 2 Product Slider](https://magepow.com/magento-product-slider.html)
* [Magento 2 Product Banner](https://magepow.com/magento-2-banner-slider.html)
**[Our Magento 2 services](https://magepow.com/magento-services.html)**
* [PSD to Magento 2 Theme Conversion](https://alothemes.com/psd-to-magento-theme-conversion.html)
* [Magento 2 Speed Optimization Service](https://magepow.com/magento-speed-optimization-service.html)
* [Magento 2 Security Patch Installation](https://magepow.com/magento-security-patch-installation.html)
* [Magento 2 Website Maintenance Service](https://magepow.com/website-maintenance-service.html)
* [Magento 2 Professional Installation Service](https://magepow.com/professional-installation-service.html)
* [Magento 2 Upgrade Service](https://magepow.com/magento-upgrade-service.html)
* [Magento 2 Customization Service](https://magepow.com/customization-service.html)
* [Hire Magento 2 Developer](https://magepow.com/hire-magento-developer.html)
**[Our Magento 2 Themes](https://alothemes.com/)**
* [Expert Multipurpose Responsive Magento 2 Theme](https://1.envato.market/c/1314680/275988/4415?u=https://themeforest.net/item/expert-premium-responsive-magento-2-and-1-support-rtl-magento-2-/21667789)
* [Gecko Premium Responsive Magento 2 Theme](https://1.envato.market/c/1314680/275988/4415?u=https://themeforest.net/item/gecko-responsive-magento-2-theme-rtl-supported/24677410)
* [Milano Fashion Responsive Magento 2 Theme](https://1.envato.market/c/1314680/275988/4415?u=https://themeforest.net/item/milano-fashion-responsive-magento-1-2-theme/12141971)
* [Electro 2 Responsive Magento 2 Theme](https://1.envato.market/c/1314680/275988/4415?u=https://themeforest.net/item/electro2-premium-responsive-magento-2-rtl-supported/26875864)
* [Electro Responsive Magento 2 Theme](https://1.envato.market/c/1314680/275988/4415?u=https://themeforest.net/item/electro-responsive-magento-1-2-theme/17042067)
* [Pizzaro Food responsive Magento 2 Theme](https://1.envato.market/c/1314680/275988/4415?u=https://themeforest.net/item/pizzaro-food-responsive-magento-1-2-theme/19438157)
* [Biolife organic responsive Magento 2 Theme](https://1.envato.market/c/1314680/275988/4415?u=https://themeforest.net/item/biolife-organic-food-magento-2-theme-rtl-supported/25712510)
* [Market responsive Magento 2 Theme](https://1.envato.market/c/1314680/275988/4415?u=https://themeforest.net/item/market-responsive-magento-2-theme/22997928)
* [Kuteshop responsive Magento 2 Theme](https://1.envato.market/c/1314680/275988/4415?u=https://themeforest.net/item/kuteshop-multipurpose-responsive-magento-1-2-theme/12985435)
* [Bencher - Responsive Magento 2 Theme](https://1.envato.market/c/1314680/275988/4415?u=https://themeforest.net/item/bencher-responsive-magento-1-2-theme/15787772)
* [Supermarket Responsive Magento 2 Theme](https://1.envato.market/c/1314680/275988/4415?u=https://themeforest.net/item/supermarket-responsive-magento-1-2-theme/18447995)
**[Our Shopify Themes](https://themeforest.net/user/alotheme)**
* [Dukamarket - Multipurpose Shopify Theme](https://1.envato.market/c/1314680/275988/4415?u=https://themeforest.net/item/dukamarket-multipurpose-shopify-theme/36158349)
* [Ohey - Multipurpose Shopify Theme](https://1.envato.market/c/1314680/275988/4415?u=https://themeforest.net/item/ohey-multipurpose-shopify-theme/34624195)
* [Flexon - Multipurpose Shopify Theme](https://1.envato.market/c/1314680/275988/4415?u=https://themeforest.net/item/flexon-multipurpose-shopify-theme/33461048)
**[Our Shopify App](https://apps.shopify.com/partners/maggicart)**
* [Magepow Infinite Scroll](https://apps.shopify.com/magepow-infinite-scroll)
* [Magepow Promotionbar](https://apps.shopify.com/magepow-promotionbar)
* [Magepow Size Chart](https://apps.shopify.com/magepow-size-chart)
**[Our WordPress Theme](https://themeforest.net/user/alotheme/portfolio)**
* [SadesMarket - Multipurpose WordPress Theme](https://1.envato.market/c/1314680/275988/4415?u=https://themeforest.net/item/sadesmarket-multipurpose-wordpress-theme/35369933)
<?php
namespace Magepow\Sizechart\Serialize\Serializer;
class Json extends \Magento\Framework\Serialize\Serializer\Json
{
public function unserialize($string)
{
if ($this->is_serialized($string)) {
$string = $this->serialize($string);
}
$result = json_decode($string, true);
if (json_last_error() !== JSON_ERROR_NONE) {
throw new \InvalidArgumentException('Unable to unserialize value.');
}
return $result;
}
function is_serialized($value, &$result = null)
{
// Bit of a give away this one
if (!is_string($value)) {
return false;
}
// Serialized false, return true. unserialize() returns false on an
// invalid string or it could return false if the string is serialized
// false, eliminate that possibility.
if ($value === 'b:0;') {
$result = false;
return true;
}
$length = strlen($value);
$end = '';
switch ($value[0]) {
case 's':
if ($value[$length - 2] !== '"') {
return false;
}
case 'b':
case 'i':
case 'd':
// This looks odd but it is quicker than isset()ing
$end .= ';';
case 'a':
case 'O':
$end .= '}';
if ($value[1] !== ':') {
return false;
}
switch ($value[2]) {
case 0:
case 1:
case 2:
case 3:
case 4:
case 5:
case 6:
case 7:
case 8:
case 9:
break;
default:
return false;
}
case 'N':
$end .= ';';
if ($value[$length - 1] !== $end[0]) {
return false;
}
break;
default:
return false;
}
if (($result = json_decode($value)) === false) {
$result = null;
return false;
}
return true;
}
}
\ No newline at end of file
<?php
namespace Magepow\Sizechart\Setup;
use Magento\Framework\DB\Ddl\Table;
use Magento\Framework\DB\Adapter\AdapterInterface;
use Magento\Framework\Setup\InstallSchemaInterface;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\SchemaSetupInterface;
class InstallSchema implements InstallSchemaInterface
{
public function install(SchemaSetupInterface $setup, ModuleContextInterface $context)
{
$installer = $setup;
$installer->startSetup();
if (!$installer->tableExists('sizechart_management')) {
$table = $installer->getConnection()
->newTable($installer->getTable('sizechart_management'));
$table->addColumn(
'entity_id',
Table::TYPE_INTEGER,
null,
[
'identity' => true,
'unsigned' => true,
'nullable' => false,
'primary' => true
],
'ENTITY ID'
)->addColumn(
'name',
Table::TYPE_TEXT,
'2M',
[],
'Name'
)
->addColumn(
'category',
Table::TYPE_TEXT,
null,
[],
'category'
)
->addColumn(
'type_display',
Table::TYPE_INTEGER,
null,
['nullable' => false, 'default' => 1],
'Size chart size display'
)
->addColumn(
'is_active',
Table::TYPE_INTEGER,
null,
[
'nullable' => false,
'default' => '1',
],
'Is Active status'
)
->addColumn(
'description',
Table::TYPE_TEXT,
'64k',
[],
'Description'
)
->addColumn(
'sizechart_info',
Table::TYPE_TEXT,
'2M',
[],
'Size Chart Information'
)->addColumn(
'conditions_serialized',
Table::TYPE_TEXT,
'2M',
[],
'Conditions Serialized'
)
->addColumn(
'sort_order',
Table::TYPE_INTEGER,
null,
['nullable' => false, 'default' => '0'],
'Sort Order'
)
->addColumn(
'updated_at',
\Magento\Framework\DB\Ddl\Table::TYPE_TIMESTAMP,
null,
['nullable' => false, 'default' => \Magento\Framework\DB\Ddl\Table::TIMESTAMP_INIT_UPDATE],
'Updated At'
)
->addColumn(
'created_at',
\Magento\Framework\DB\Ddl\Table::TYPE_TIMESTAMP,
null,
['nullable' => false, 'default' => \Magento\Framework\DB\Ddl\Table::TIMESTAMP_INIT],
'Creation Time'
);
$installer->getConnection()->createTable($table);
$installer->getConnection()->addIndex(
$installer->getTable('sizechart_management'),
$setup->getIdxName(
$installer->getTable('sizechart_management'),
['name', 'description', 'sizechart_info'],
\Magento\Framework\DB\Adapter\AdapterInterface::INDEX_TYPE_FULLTEXT
),
['name', 'description', 'sizechart_info'],
\Magento\Framework\DB\Adapter\AdapterInterface::INDEX_TYPE_FULLTEXT
);
}
$installer->endSetup();
}
}
\ No newline at end of file
<?php
namespace Magepow\Sizechart\Setup;
use Magento\Framework\Setup\UpgradeSchemaInterface;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\SchemaSetupInterface;
use Magento\Framework\DB\Ddl\Table;
class UpgradeSchema implements UpgradeSchemaInterface
{
public function upgrade(SchemaSetupInterface $setup, ModuleContextInterface $context)
{
$setup->startSetup();
$tableName = $setup->getTable('sizechart_management');
if (version_compare($context->getVersion(), '2.0.0', '<')) {
if ($setup->getConnection()->isTableExists($tableName) == true) {
$connection = $setup->getConnection();
$connection->addColumn(
$setup->getTable($tableName),
'template_css',
[
'type' => Table::TYPE_TEXT,
'length' => '2M',
'nullable' => true,
'comment' => 'template css'
]
);
}
}
if (version_compare($context->getVersion(), '2.3.0', '<')) {
if ($setup->getConnection()->isTableExists($tableName) == true) {
$connection = $setup->getConnection();
$connection->addColumn(
$setup->getTable($tableName),
'stores',
[
'type' => Table::TYPE_TEXT,
'length' => '2M',
'nullable' => false,
'comment' => 'Store Views'
]
);
}
}
if (version_compare($context->getVersion(), '2.5.2', '<')) {
if ($setup->getConnection()->isTableExists($tableName) == true) {
$connection = $setup->getConnection();
$connection->addColumn(
$setup->getTable($tableName),
'custom_size',
[
'type' => Table::TYPE_TEXT,
'nullable' => false,
'comment' => 'custom size'
]
);
$connection->addColumn(
$setup->getTable($tableName),
'column_label',
[
'type' => Table::TYPE_TEXT,
'nullable' => false,
'comment' => 'column label'
]
);
}
}
}
}
\ No newline at end of file
<?php
namespace Magepow\Sizechart\Ui\Component\Listing\Sizechart\Column;
use Magento\Framework\View\Element\UiComponent\ContextInterface;
use Magento\Framework\View\Element\UiComponentFactory;
use Magento\Ui\Component\Listing\Columns\Column;
use Magento\Framework\UrlInterface;
class Action extends Column
{
/** Url path */
const ROW_EDIT_URL = 'magepow_sizechart/sizechart/addrow';
/** @var UrlInterface */
protected $_urlBuilder;
/**
* @var string
*/
private $_editUrl;
/**
* @param ContextInterface $context
* @param UiComponentFactory $uiComponentFactory
* @param UrlInterface $urlBuilder
* @param array $components
* @param array $data
* @param string $editUrl
*/
public function __construct(
ContextInterface $context,
UiComponentFactory $uiComponentFactory,
UrlInterface $urlBuilder,
array $components = [],
array $data = [],
$editUrl = self::ROW_EDIT_URL
) {
$this->_urlBuilder = $urlBuilder;
$this->_editUrl = $editUrl;
parent::__construct($context, $uiComponentFactory, $components, $data);
}
/**
* Prepare Data Source.
*
* @param array $dataSource
*
* @return array
*/
public function prepareDataSource(array $dataSource)
{
if (isset($dataSource['data']['items'])) {
foreach ($dataSource['data']['items'] as &$item) {
$name = $this->getData('name');
if (isset($item['entity_id'])) {
$item[$name]['edit'] = [
'href' => $this->_urlBuilder->getUrl(
$this->_editUrl,
['id' => $item['entity_id']]
),
'label' => __('Edit'),
];
}
}
}
return $dataSource;
}
}
{
"name": "magepow/sizechart",
"description": "Size chart extension for Magento helps you create size charts for products on your website.",
"require": {
"magepow/core": "^1.0.0"
},
"type": "magento2-module",
"license": [
"OSL-3.0",
"AFL-3.0"
],
"authors": [
{
"name": "Magepow",
"email": "support@magepow.com",
"homepage": "https://magepow.com",
"role": "Technical Support"
}
],
"autoload": {
"files": [
"registration.php"
],
"psr-4": {
"Magepow\\Sizechart\\": ""
}
}
}
\ No newline at end of file
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd">
<acl>
<resources>
<resource id="Magento_Backend::admin">
<resource id="Magepow_Sizechart::magepow" title="Size Chart" sortOrder="10">
<resource id="Magepow_Sizechart::sizechart" title="Size Chart Management" sortOrder="50" />
</resource>
<resource id="Magento_Backend::stores">
<resource id="Magento_Backend::stores_settings">
<resource id="Magento_Config::config">
<resource id="Magepow_Sizechart::config" title="Size Chart"/>
</resource>
</resource>
</resource>
</resource>
</resources>
</acl>
</config>
\ No newline at end of file
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Backend:etc/menu.xsd">
<menu>
<update id="magepow" title="SizChart" module="Magepow_Sizechart" sortOrder="10" resource="Magepow_Sizechart::magepow" />
<add id="Magepow_Sizechart::magepow" title="Size Chart" module="Magepow_Sizechart" sortOrder="10" parent="magepow" resource="Magepow_Sizechart::magepow" />
<add id="Magepow_Sizechart::sizechart" title="Size Chart Management" module="Magepow_Sizechart" parent="Magepow_Sizechart::magepow" sortOrder="20" action="magepow_sizechart/sizechart" resource="Magepow_Sizechart::sizechart"/>
<add id="Magepow_Sizechart::config" title="Configuration" module="Magepow_Sizechart" parent="Magepow_Sizechart::magepow" sortOrder="30" action="adminhtml/system_config/edit/section/magepow_sizechart" resource="Magepow_Sizechart::sizechart_configuration"/>
</menu>
</config>
\ No newline at end of file
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
<router id="admin">
<route id="magepow_sizechart" frontName="magepow_sizechart">
<module name="Magepow_Sizechart"/>
</route>
</router>
</config>
\ No newline at end of file
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
<system>
<section id="magepow_sizechart" translate="label" sortOrder="130" showInDefault="1" showInWebsite="1" showInStore="1">
<class>separator-top</class>
<label>Size Chart</label>
<tab>joshine</tab>
<resource>Magepow_Sizechart::config</resource>
<group id="general" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="0" showInStore="0">
<label><![CDATA[General]]></label>
<field id="enabled" translate="label" type="select" sortOrder="1" showInDefault="1" showInWebsite="0" showInStore="1" canRestore="1">
<label>Module Enable</label>
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
</field>
<field id="display_text" translate="label" type="text" sortOrder="1" showInDefault="1" showInWebsite="0" showInStore="1" canRestore="1">
<label>Display Text Link</label>
<comment>This text will display the link for showing popup sizechart</comment>
<depends>
<field id="enabled">1</field>
</depends>
</field>
<field id="image_icon" translate="label" type="image" sortOrder="20" showInDefault="1" showInWebsite="0" showInStore="0" canRestore="1">
<label>Image Icon</label>
<comment>This section will display the icon for showing popup sizechart</comment>
<backend_model>Magento\Config\Model\Config\Backend\Image</backend_model>
<upload_dir config="system/filesystem/media" scope_info="1">magepow/sizechart</upload_dir>
<base_url type="media" scope_info="1">magepow/sizechart</base_url>
<depends>
<field id="enabled">1</field>
</depends>
</field>
</group>
</section>
</system>
</config>
\ No newline at end of file
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd">
<default>
<magepow_sizechart>
<general>
<enabled>1</enabled>
<display_text>Size Chart</display_text>
</general>
</magepow_sizechart>
</default>
</config>
\ No newline at end of file
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd">
<preference for="Magepow\Sizechart\Api\Data\SizechartInterface" type="Magepow\Sizechart\Model\Sizechart" />
<preference for="Magento\Framework\Serialize\Serializer\Json" type="Magepow\Sizechart\Serialize\Serializer\Json" />
<type name="Magento\Framework\View\Element\UiComponent\DataProvider\CollectionFactory">
<arguments>
<argument name="collections" xsi:type="array">
<item name="magepow_sizechart_sizechart_listing_data_source" xsi:type="string">Magepow\Sizechart\Model\ResourceModel\Sizechart\Grid\Collection</item>
</argument>
</arguments>
</type>
<virtualType name="Magepow\Sizechart\Model\ResourceModel\Sizechart\Grid\Collection" type="Magento\Framework\View\Element\UiComponent\DataProvider\SearchResult">
<arguments>
<argument name="mainTable" xsi:type="string">sizechart_management</argument>
<argument name="resourceModel" xsi:type="string">Magepow\Sizechart\Model\ResourceModel\Sizechart</argument>
</arguments>
</virtualType>
</config>
\ No newline at end of file
<?xml version="1.0"?>
<!--
/**
* Copyright © 2016 ExtensionsMall All rights reserved.
* See COPYING.txt for license details.
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Magepow_Sizechart" setup_version="2.5.2"/>
<sequence>
<module name="Magento_Catalog"/>
</sequence>
</config>
\ No newline at end of file
<?php
/**
* Copyright © 2016 ExtensionsMall. All rights reserved.
* See COPYING.txt for license details.
*/
\Magento\Framework\Component\ComponentRegistrar::register(
\Magento\Framework\Component\ComponentRegistrar::MODULE,
'Magepow_Sizechart',
__DIR__
);
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-2columns-left"
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceContainer name="left">
<block class="Magepow\Sizechart\Block\Adminhtml\Sizechart\Edit\Tabs" name="tabs"/>
</referenceContainer>
<referenceContainer name="content">
<block class="Magepow\Sizechart\Block\Adminhtml\Sizechart\AddRow" name="add_row" />
</referenceContainer>
</body>
</page>
\ No newline at end of file
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd">
<body>
<referenceContainer name="content">
<uiComponent name="magepow_sizechart_sizechart_listing"/>
</referenceContainer>
</body>
</page>
\ No newline at end of file
<style>
.admin__data-grid-wrap {
margin-bottom: 2rem;
max-width: 100%;
overflow-x: auto;
padding-bottom: 1rem;
padding-top: 2rem;
}
.data-grid {
border: none;
font-size: 1.3rem;
margin-bottom: 0;
width: 100%;
}
.data-grid th:first-child {
border-left-color: #8a837f;
}
.data-grid .data-grid-th {
background-clip: padding-box;
color: #fff;
padding: 1rem 1rem;
position: relative;
vertical-align: middle;
}
.data-grid th {
background-color: #514943;
border: 0.1rem solid #8a837f;
border-left-color: transparent;
color: #fff;
font-weight: 600;
padding: 0;
text-align: left;
}
.data-grid th, .data-grid td {
font-size: 1.3rem;
line-height: 1.36;
transition: background-color .1s linear;
vertical-align: middle;
}
.form-inline .form-control {
display: inline-block;
width: 85px;
vertical-align: middle;
}
#rowheader input {
background-color: #e9e9e9;
border-color: #adadad;
color: #303030;
opacity: .5;
}
</style>
<?php
/**
* @var $block \Magepow\Sizechart\Block\Adminhtml\Sizechart\ChartTable
*/
$data = $block->getCustomSizeData();
?>
<div class="admin__field" id="content_table_detail">
<input id="chart_data" name="chart_data" data-ui-id="index-edit-form-fieldset-element-hidden-chart-data" value="<?= isset($data['custom_size']) ? htmlentities($data['custom_size']) : '' ?>" title="Chart Data" type="hidden"/>
<input id="table_content" name="table_content" data-ui-id="index-edit-form-fieldset-element-text-table-content" value="" title="Content" type="hidden" class=" input-text admin__control-text"/>
</div>
<script>
require(['jquery', 'ko', 'jquery/ui'], function ($, ko) {
var viewModel = {
chartData: ko.observableArray([])
};
function reindexcustomoptions() {
var i = 0;
var j = 0;
var tableLabelLength = getTableLabels().length + 1;
$("input[id='custom_size[][]']").map(function () {
if (i === tableLabelLength)
{
i = 0;
j++;
}
$(this).attr('name', 'custom_size[' + j + '][' + i + ']');
i++;
});
}
function getTableLabels()
{
var tableLabelArray = Array();
$("#cutom_size_table thead tr th input").each(function (i, v) {
tableLabelArray[i] = $(this).val();
});
console.log("======TableLabelArray======")
console.log(tableLabelArray);
tableLabelArray.shift();
return tableLabelArray;
}
function removeLabelColumn(index)
{
$('#cutom_size_table').closest("table").find("thead").find("tr").find("th:eq(" + index + ")").remove();
$('#cutom_size_table').closest("table").find("tbody").find("tr").find("td:eq(" + index + ")").remove();
}
function getRemovedLabels(existing_list, new_list)
{
var removed_element = [];
jQuery.grep(existing_list, function (el) {
if (jQuery.inArray(el, new_list) === -1)
removed_element.push(el);
});
return removed_element;
}
function escapeHtml(unsafe) {
return unsafe
.replace(/&/g, "&amp;")
.replace(/</g, "&lt;")
.replace(/>/g, "&gt;")
.replace(/"/g, "&quot;")
.replace(/'/g, "&#039;");
}
function parseCsvFile(data)
{
if ($('#chart_data').val() == ''){
var allRows = data.split(/\r?\n|\r/);
}
else
{
var allRows=data;
}
var table = "<div class='sizechartoption' id='data_grid_csv_filename'>";
table += "<div class='admin__data-grid-wrap'>";
table += '<table class="data-grid data-grid-draggable" id="cutom_size_table">';
for (var singleRow = 0; singleRow < allRows.length; singleRow++) {
if (singleRow === 0) {
table += '<thead>';
table += '<tr>';
} else {
table += '<tr id="row1">';
}
if ($('#chart_data').val() == ''){
var rowCells = allRows[singleRow].split(',');
}
else
{
var rowCells = allRows[singleRow];
}
for (var rowCell = 0; rowCell < rowCells.length; rowCell++) {
if (singleRow === 0) {
table += '<th id="rowheader" class="data-grid-th">';
table += '<input name="custom_size[][]" id="custom_size[][]" class="form-control" value=' + rowCells[rowCell] + ' readonly/>';
table += '</th>';
} else {
if (rowCells[rowCell] !== "")
{
String.prototype.unquoted = function () {
return this.replace(/(^")|("$)/g, '');
};
var result = rowCells[rowCell].unquoted();
result = result.replace(/\"\"/g, "\"");
result = escapeHtml(result);
var result_ = result.replace(/\\/g, "");
table += '<td>';
table += '<input class="form-control" value="' + result_ + '" type="text" id="custom_size[][]" name="custom_size[][]" required/>';
table += '</td>';
}
if (rowCell === (rowCells.length - 1) && rowCells[rowCell] !== "")
{
table += "<td><input type='button' id='delete_custom_size' class='btn btn-danger btn-sm' value='DELETE'/></td>";
}
}
}
if (singleRow === 0) {
table += '<th class="data-grid-th"><button type="button" class="btn btn-primary add-record" id="back_button">Back</button></th></tr>';
table += '</thead>';
table += '<tbody>';
} else {
table += '</tr>';
}
}
table += '</tbody>';
table += "<tfoot><tr><td colspan='" + (allRows.length + 2) + "'><button type='button' class='btn btn-success add-record' id='add_row_button'>Add Row</button></td></tr></tfoot>";
table += '</table></div></div>';
console.log(table);
$("#content_table_detail").show();
jQuery("#table_content").replaceWith(table);
reindexcustomoptions();
}
$(document).ready(function () {
if ($('#chart_data').val() !== ''){
var data=$.parseJSON($('#chart_data').val());
parseCsvFile(data);
$("#content_table_detail").show();
}
$(document).on('beforeSubmit', function (e) {
if (typeof varienGlobalEvents !== 'undefined') {
varienGlobalEvents.fireEvent('formSubmit', $(e.target).attr('id'));
}
});
$(document).on('click', '#delete_custom_size', function () {
$(this).closest('tr').remove();
reindexcustomoptions();
});
$(document).on('click', '#back_button', function () {
$('#content').val("").val(getTableLabels());
var new_content = '<input id="table_content" name="table_content" data-ui-id="sizechart-index-edit-form-fieldset-element-text-grid-content" value="" title="Content" style="display:none;" class=" input-text admin__control-text" type="text">';
jQuery("#data_grid_content").replaceWith(new_content);
$("#content_single_field").show();
$("#content_table_detail").hide();
});
$(document).on('click', '#add_row_button', function () {
var contentString = $("#content").val();
var contentArray = contentString.split(',');
var $rowno = $("#cutom_size_table tbody tr").length;
$rowno = $rowno + 1;
var $td = "<td><input class='form-control' type='text' id='custom_size[][]' name='custom_size[][]' required/></td>";
for (var i = 0; i < contentArray.length; i++)
{
$td += "<td><input class='form-control' type='text' id='custom_size[][]' name='custom_size[][]' required/></td>";
}
$td += "<td><input type='button' id='delete_custom_size' class='btn btn-danger btn-sm' value='DELETE'/></td>";
$("#cutom_size_table tbody tr:last").after("<tr id='row" + $rowno + "'>" + $td + "</tr>");
reindexcustomoptions();
});
function displayEmptyError()
{
$("#comment").replaceWith("<small id='comment' style='color:Red;'>Please Enter Custom Option Seperated By <strong> \",\"</strong> </small>");
$("#content").focus();
return false;
}
function validateContent()
{
var contentString = $("#content").val();
var re = /^\w(\s*,?\s*\w)*$/;
return re.test(contentString);
}
function displayRegError()
{
var message = "<small id='comment' style='color:Red;'><ul>";
message += "<li>Please Enter Valid Custom Option</li>";
message += "<li>Do not use <strong> (,)</strong> At the Start and End of Custom Options</li>";
message += "<li>Do not use <strong> ( ,, )</strong> or special characters except <strong>( _ )</strong> in between Custom Options</li>";
message += "</ul></small>";
$("#comment").replaceWith(message);
$("#content").focus();
return false;
}
function validateContentUnique()
{
var contentString = $("#content").val();
var contentArray = contentString.split(',');
var valuesSoFar = Object.create(null);
for (var i = 0; i < contentArray.length; ++i)
{
//去重
var value = contentArray[i];
if (value in valuesSoFar)
{
$("#comment").replaceWith("<small id='comment' style='color:Red;'>Please Enter Unique Custom Options...</small>");
$("#content").focus();
return false;
}
valuesSoFar[value] = true;
}
return true
}
function displayUniqueError()
{
$("#comment").replaceWith("<small id='comment' style='color:Red;'>Please Enter Unique Custom Options...</small>");
$("#content").focus();
return false;
}
function tableHasData()
{
return $("#chart_data").val() != "";
}
function mergeNewTable()
{
var tableLabelArray = Array();
var newLabels = $("#content").val();
tableLabelArray = getTableLabels();
var newLabelArray = newLabels.split(',');
var labelToRemove = getRemovedLabels(tableLabelArray, newLabelArray);
if (labelToRemove.length !== 0)
{
for (var i = 0; i < labelToRemove.length; i++)
{
tableLabelArray = getTableLabels();
var index = jQuery.inArray(labelToRemove[i], tableLabelArray);
removeLabelColumn((index + 1));
}
}
var newColumnToAdd = $(newLabelArray).not(tableLabelArray).get();
if (newColumnToAdd !== '')
{
for (var i = 0; i < newColumnToAdd.length; i++) {
var index = jQuery.inArray(newColumnToAdd[i], newLabelArray);
$(`<th id='rowheader' class='data-grid-th'><input value='${newColumnToAdd[i]}' class='form-control' type='text' id='customsize[][]' name='customsize[][]' readonly/></th>`).insertAfter('#cutom_size_table thead tr th:nth-child(' + (index + 1) + ')');
$("<td class='data-grid-td'><input class='form-control' type='text' id='customsize[][]' name='customsize[][]' required/></td>").insertAfter('#cutom_size_table tbody tr td:nth-child(' + (index + 1) + ')');
}
}
$('#content_table_detail').show();
reindexcustomoptions();
}
function renderTable()
{
var contentString = $("#content").val();
var contentArray = contentString.split(',');
var content = "<div class='sizechartoption' id='data_grid_content'>";
content += "<div class='admin__data-grid-wrap'>";
content += "<table class='data-grid data-grid-draggable' id='cutom_size_table'><thead><tr><th id='rowheader' class='data-grid-th'><input name='custom_size[][]' id='custom_size[][]' class='form-control' value='Options'/></th>";
$.each(contentArray, function (index, value) {
content += `<th class='data-grid-th'><input name='custom_size[][]' id='custom_size[][]' class='form-control' value='${value}' readonly/></th>`;
});
content += "<th class='data-grid-th'><button type='button' s='btn btn-primary add-record' id='back_button'>Back</button></th>";
content += "</tr></thead><tbody><tr id='row1'></tr></tbody>";
content += "<tfoot><tr><td colspan='" + (contentArray.length + 2) + "'><button type='button' class='btn btn-success add-record' id='add_row_button'>Add Row</button></td></tr></tfoot></table></div>";
$("#content_single_field").toggle();
$("#content_table_detail").show();
jQuery("#table_content").replaceWith(content);
}
$("#register").click(function () {
if ($("#content").val() === '')
{
return displayEmptyError();
}
if (!validateContent())
{
return displayRegError();
}
if (!validateContentUnique()) {
return displayUniqueError();
}
if (tableHasData()) {
mergeNewTable();
return;
}
renderTable();
reindexcustomoptions();
});
});
});
</script>
<?php
/**
* @var $block \Magepow\Sizechart\Block\Adminhtml\Sizechart\ChartTable
*/
?>
<div class="admin__control" id="content_single_field">
<input id="content" name="column_label" data-ui-id="adminhtml-sizechart-edit-tab-main-0-fieldset-element-text-name"
value="<?= $block->getCustomSizeData()['column_label'] ?? '' ?>" title="Name" class="required_entry input-text admin__control-text required-entry _required"
type="text" aria-required="true">
<p class="note">
<span>The sizechart table head</span>
<br>
<span id="comment"></span>
</p>
<input class="btn btn-info pull-left add-record" id="register" name="register" value="Add Data" type="button">
<input class="pull-right add-record" id="csvfile" name="csvfile" value="Add Data" type="file" style="display: none;">
</div>
<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
<argument name="data" xsi:type="array">
<item name="js_config" xsi:type="array">
<item name="provider" xsi:type="string">magepow_sizechart_sizechart_listing.magepow_sizechart_sizechart_listing_data_source</item>
<item name="deps" xsi:type="string">magepow_sizechart_sizechart_listing.magepow_sizechart_sizechart_listing_data_source</item>
</item>
<item name="spinner" xsi:type="string">spinner_columns</item>
<item name="buttons" xsi:type="array">
<item name="add" xsi:type="array">
<item name="name" xsi:type="string">add</item>
<item name="label" xsi:type="string" translate="true">Add New Size Chart Rule </item>
<item name="class" xsi:type="string">primary</item>
<item name="url" xsi:type="string">magepow_sizechart/sizechart/addrow</item>
</item>
</item>
</argument>
<dataSource name="magepow_sizechart_sizechart_listing_data_source">
<argument name="dataProvider" xsi:type="configurableObject">
<argument name="class" xsi:type="string">Magento\Framework\View\Element\UiComponent\DataProvider\DataProvider</argument>
<argument name="name" xsi:type="string">magepow_sizechart_sizechart_listing_data_source</argument>
<argument name="primaryFieldName" xsi:type="string">entity_id</argument>
<argument name="requestFieldName" xsi:type="string">id</argument>
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="component" xsi:type="string">Magento_Ui/js/grid/provider</item>
<item name="update_url" xsi:type="url" path="mui/index/render"/>
<item name="storageConfig" xsi:type="array">
<item name="indexField" xsi:type="string">entity_id</item>
</item>
</item>
</argument>
</argument>
</dataSource>
<listingToolbar name="listing_top">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="sticky" xsi:type="boolean">true</item>
</item>
</argument>
<bookmark name="bookmarks"/>
<columnsControls name="columns_controls"/>
<exportButton name="export_button"/>
<filters name="listing_filters" />
<filterSearch name="fulltext"/>
<massaction name="listing_massaction">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="component" xsi:type="string">Magento_Ui/js/grid/tree-massactions</item>
</item>
</argument>
<action name="delete">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="type" xsi:type="string">delete</item>
<item name="label" xsi:type="string" translate="true">Delete</item>
<item name="url" xsi:type="url" path="magepow_sizechart/sizechart/massdelete"/>
<item name="confirm" xsi:type="array">
<item name="title" xsi:type="string" translate="true">Delete Size Chart Rule</item>
<item name="message" xsi:type="string" translate="true">Are you sure you want to delete selected items?</item>
</item>
</item>
</argument>
</action>
</massaction>
<paging name="listing_paging"/>
</listingToolbar>
<columns name="spinner_columns">
<selectionsColumn name="ids">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="resizeEnabled" xsi:type="boolean">false</item>
<item name="resizeDefaultWidth" xsi:type="string">55</item>
<item name="indexField" xsi:type="string">entity_id</item>
</item>
</argument>
</selectionsColumn>
<column name="entity_id">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="filter" xsi:type="string">textRange</item>
<item name="sorting" xsi:type="string">asc</item>
<item name="label" xsi:type="string" translate="true">ID</item>
</item>
</argument>
</column>
<column name="name">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="filter" xsi:type="string">textRange</item>
<item name="sorting" xsi:type="string">asc</item>
<item name="label" xsi:type="string" translate="true">Name</item>
</item>
</argument>
</column>
<column name="is_active" >
<argument name="data" xsi:type="array">
<item name="options" xsi:type="object">Magepow\Sizechart\Model\Status</item>
<item name="config" xsi:type="array">
<item name="filter" xsi:type="string">select</item>
<item name="component" xsi:type="string">Magento_Ui/js/grid/columns/select</item>
<item name="dataType" xsi:type="string">select</item>
<item name="label" xsi:type="string" translate="true">Is Active</item>
</item>
</argument>
</column>
<column name="created_at" class="Magento\Ui\Component\Listing\Columns\Date">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="filter" xsi:type="string">dateRange</item>
<item name="component" xsi:type="string">Magento_Ui/js/grid/columns/date</item>
<item name="dataType" xsi:type="string">date</item>
<item name="label" xsi:type="string" translate="true">Created</item>
</item>
</argument>
</column>
<actionsColumn name="actions" class = "Magepow\Sizechart\Ui\Component\Listing\Sizechart\Column\Action">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="resizeEnabled" xsi:type="boolean">false</item>
<item name="resizeDefaultWidth" xsi:type="string">107</item>
<item name="indexField" xsi:type="string">id</item>
</item>
</argument>
</actionsColumn>
</columns>
</listing>
\ No newline at end of file
...@@ -75,7 +75,136 @@ ...@@ -75,7 +75,136 @@
'description' 'description'
); );
$chartBlock = $objectManager->create(\Magepow\Sizechart\Block\Product\Sizechart::class);
$sizeChart = $chartBlock->getSizeChart();
$chartTableArray = [];
$chartInfo = '';
$chartEnabled = 1;
$sizeDesc = '';
if ($sizeChart != null) {
$chartTable = $sizeChart->getData('custom_size');
$sizeDesc = $sizeChart->getData('description');
$chartTableArray = json_decode($chartTable, true);
$chartInfo = $sizeChart->getData('sizechart_info');
}
?> ?>
#chart-image {
margin: 0 0 0 0;
border-collapse: collapse;
width: 30%;
float: left;
}
.swatch-attribute.size .swatch-attribute-selected-option{
font-size: .95rem !important;
}
#chart-details {
border-collapse: collapse;
width: 100%;
overflow: auto;
}
#chart-details .tbody .td:first-child {
font-weight: bold;
}
#fme_sizechart_table {
margin: 0 0 0 0;
border-collapse: collapse;
width: 100%;
}
#fme_sizechart_table_th {
background: #111;
border: 1px solid #111;
padding:8px 0;
color: #fff;
/*
font-weight: 600 !important;
*/
}
#fme_sizechart_table .td {
border: 1px solid #f8f8f8;
}
#fme_sizechart_table .td.bold {
/*
font-weight:600 !important;
*/
}
#fme_sizechart_table .th, .table .td {
font-size: .9rem;
padding: .33rem !important;
text-align: center;
}
#fme_sizechart_table .tr:nth-child(2n) {
background: #f8f8f8 ;
}
.scrollable_content {
width:100%;
overflow:auto;
}
@media only screen and (max-width:768px){
#chart-image {
margin: 0 0 0 0;
border-collapse: collapse;
width: 100%;
}
#chart-details {
margin: 0 0 0 0;
border-collapse: collapse;
width: 100%;
overflow: auto;
}
}
.sizechart_icon{
width: 30px;
display: inline-block;
margin-bottom: 0;
font-weight: normal;
text-align: center;
vertical-align: middle;
-ms-touch-action: manipulation;
touch-action: manipulation;
cursor: pointer;
background-image: none;
border: 1px solid transparent;
white-space: nowrap;
padding: 6px 12px;
font-size: 14px;
line-height: 1.42857143;
border-radius: 4px;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.chart-details {
margin-top: 20px;
}
.chart-size-switch {
margin: 10px 10px 10px 0;
}
.chart-size-switch .chart-size-switch-item{
display: inline-block;
padding: 0 0.9rem;
line-height: 1.99rem;
height: 2rem;
border: 1px solid #f3f3f3;
color: #666;
cursor: pointer;
}
.chart-size-switch-item.-active {
background-color: #111;
color: white;
}
</style> </style>
<script> <script>
...@@ -171,23 +300,93 @@ ...@@ -171,23 +300,93 @@
} }
return mobile_flag; return mobile_flag;
} }
$('.chart-size-switch-item').click(function(data) {
if ($(this).hasClass('-active')) {
return;
}
var currentType = $('.chart-size-switch-item.-active').data('size-type');
$(this).addClass('-active').siblings().removeClass('-active');
var type = $(this).data('size-type');
var percent = 2.54;
if (currentType == type) {
return;
}
$.each($(".size-item"), function (x) {
var current = $(this).data('size-item-inc');
if (currentType == 'inc' && type == 'cm') {
var data = (current * percent - 0).toFixed(2);
} else {
var data = $(this).data('size-item-inc');
}
$(this).html(data);
});
});
$(document).ready(function () {
$('.chart-size-switch-item-cm').click();
});
}); });
</script> </script>
<li class="lis" style="display: none;"> <li class="lis" style="display: none;">
<section id="areaLayer" class="express-area-box"> <section id="areaLayer" style="z-index: 996;" class="express-area-box">
<article id="areaBox"> <article id="areaBox">
<ul class="remen" id="remen"> <ul class="remen" id="remen">
<li class="lastli lastli-left"></li> <li class="lastli lastli-left"></li>
<li class="lastli lastli-right" style="cursor:pointer">X</li> <li class="lastli lastli-right" style="cursor:pointer">X</li>
</ul> </ul>
<div class="area-content"> <div class="area-content">
<div id="size-chart" style="display: none;"> <div id="size-chart" style="display: none;padding: 1.6em;">
<?php if ($chartBlock->isEnabled() && (count($chartTableArray) > 1)): ?>
<h4 class="joshine-text-center">Size Guide</h4>
<div id="chart-details">
<div class="chart-size-switch ">
<input type="hidden" value="">
<span class="chart-size-switch-item chart-size-switch-item-cm" data-size-type="cm"><?= __('cm'); ?></span>
<span data-size-type="inc" class="chart-size-switch-item -active"><?= __('Inch'); ?></span>
</div>
<!--全局table已被污染,请使用div模拟表格-->
<div class="table" id="fme_sizechart_table" style="display: table;">
<div style="display: table-header-group;" class="thead">
<?php if(isset($chartTableArray[0])): ?>
<div id="fme_sizechart_table_th" class="tr" style="display: table-row;">
<?php foreach ($chartTableArray[0] as $head): ?>
<div style="display: table-cell;" class="th"><?= $head ?></div>
<?php endforeach; ?>
</div>
<?php endif; ?>
</div>
<div style="display: table-row-group" class="tbody">
<?php if(isset($chartTableArray)): ?>
<?php foreach ($chartTableArray as $key => $body): ?>
<?php
if ($key == 0) {
continue;
}
?>
<div style="display: table-row" class="tr">
<?php foreach ($body as $key2 => $item): ?>
<div style="display: table-cell" class="td <?php if($key2 != 0) { echo 'size-item'; } ?> " data-size-item-inc="<?= $item ?>"><?= $item ?> </div>
<?php endforeach; ?>
</div>
<?php endforeach; ?>
<?php endif; ?>
</div>
</div>
</div>
<?php if($sizeDesc): ?>
<span class="size-desc"><?= $sizeDesc ?></span>
<?php endif; ?>
<?php echo $chartBlock->getContentFromStaticBlock($chartInfo);?>
<?php else: ?>
<?php <?php
$productCharTemplate = $block->getProduct()->getAttributeText("sizeTemplate"); $productCharTemplate = $block->getProduct()->getAttributeText("sizeTemplate");
if (empty($block->getProduct()->getAttributeText("sizeTemplate"))){ if (empty($block->getProduct()->getAttributeText("sizeTemplate"))){
$productCharTemplate = "product-size-chart-default"; $productCharTemplate = "product-size-chart-default";
} }
echo $block->getLayout()->createBlock('Magento\Cms\Block\Block')->setBlockId($productCharTemplate)->toHtml();?> echo $block->getLayout()->createBlock('Magento\Cms\Block\Block')->setBlockId($productCharTemplate)->toHtml();
?>
<? endif; ?>
</div> </div>
<div id="free-return" style="display: none;"> <div id="free-return" style="display: none;">
<?php echo $block->getLayout()->createBlock('Magento\Cms\Block\Block')->setBlockId('product-intro-free-return')->toHtml();?> <?php echo $block->getLayout()->createBlock('Magento\Cms\Block\Block')->setBlockId('product-intro-free-return')->toHtml();?>
...@@ -209,11 +408,21 @@ ...@@ -209,11 +408,21 @@
<div id="areaMask" class="mask"></div> <div id="areaMask" class="mask"></div>
</li> </li>
<style> <style>
.size-chart {
padding-right: 20px !important;
padding-left: 20px !important;
}
.size-desc {
font-size: .85em;
color: #9E9E9E;
display: inline-block;
margin-bottom: 1em;
}
#product-intro__freeshipping-more-3{ #product-intro__freeshipping-more-3{
display: revert; display: revert;
color: #2d68a; color: #2d68a;
float: right; float: right;
margin-top: 0px; margin-top: 0;
font-size: .9em; font-size: .9em;
text-decoration: underline; text-decoration: underline;
} }
...@@ -242,13 +451,13 @@ ...@@ -242,13 +451,13 @@
height: auto; height: auto;
background-color: #fff; background-color: #fff;
position: fixed; position: fixed;
left: 0px; left: 0;
bottom: 0px; bottom: 0;
z-index: 100; z-index: 100;
padding: 5px; padding: 5px;
display: list-item; display: list-item;
list-style: none; list-style: none;
box-shadow: 0px 0px 16px; box-shadow: 0 0 16px;
} }
.lastli-right{ .lastli-right{
width: 20%; width: 20%;
......
...@@ -7,31 +7,14 @@ ...@@ -7,31 +7,14 @@
--> -->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="checkout" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="checkout" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body> <body>
<referenceContainer name="checkout.header.wrapper" remove="true"/>
<referenceContainer name="page.bottom.container" remove="true"/> <referenceContainer name="page.bottom.container" remove="true"/>
<referenceContainer name="footer-container" remove="true"/> <referenceContainer name="footer-container" remove="true"/>
<referenceBlock name="catalog.topnav" remove="true" /> <referenceBlock name="catalog.topnav" remove="true" />
<referenceBlock name="top.search" remove="true" /> <referenceBlock name="top.search" remove="true" />
<referenceBlock name="sparsh.free-shipping.bar.top" remove="true" /> <referenceBlock name="sparsh.free-shipping.bar.top" remove="true" />
<referenceBlock name="free-shipping.bar" remove="true" />
<referenceContainer name="checkout.header.container">
<block class="Magento\Cms\Block\Block" name="cart.payment.top">
<arguments>
<argument name="block_id" xsi:type="string">cart_payment_top</argument>
</arguments>
</block>
</referenceContainer>
<referenceContainer name="columns.top">
<block class="Magento\Cms\Block\Block" name="progress.bar" before="-">
<arguments>
<argument name="block_id" xsi:type="string">progress_bar</argument>
</arguments>
</block>
</referenceContainer>
<referenceContainer name="content">
<block class="Magento\Framework\View\Element\Template" name="checkout.cart.footer" template="Magento_Checkout::footer.phtml" />
</referenceContainer>
<referenceBlock name="checkout.cart.addtocart" remove="true" /> <referenceBlock name="checkout.cart.addtocart" remove="true" />
<referenceBlock name="checkout.root"> <referenceBlock name="checkout.root">
<arguments> <arguments>
...@@ -40,6 +23,122 @@ ...@@ -40,6 +23,122 @@
<item name="checkout" xsi:type="array"> <item name="checkout" xsi:type="array">
<item name="component" xsi:type="string">Magento_Checkout/js/view/shipping-get</item> <item name="component" xsi:type="string">Magento_Checkout/js/view/shipping-get</item>
<item name="children" xsi:type="array"> <item name="children" xsi:type="array">
<item name="logo-nav" xsi:type="array">
<item name="component" xsi:type="string">Magento_Checkout/js/view/logo-nav</item>
<item name="displayArea" xsi:type="string">logo-nav</item>
<item name="children" xsi:type="array">
<item name="logo-nav-sidebar" xsi:type="array">
<item name="component" xsi:type="string">Magento_Checkout/js/view/sidebar</item>
<item name="displayArea" xsi:type="string">logo-nav-sidebar</item>
<item name="config" xsi:type="array">
<item name="template" xsi:type="string">Magento_Checkout/sidebar</item>
<item name="deps" xsi:type="array">
<item name="0" xsi:type="string">checkout.steps</item>
</item>
</item>
<item name="children" xsi:type="array">
<item name="cart_items" xsi:type="array">
<item name="component" xsi:type="string">Magento_Checkout/js/view/summary/cart-items</item>
<item name="displayArea" xsi:type="string">estimation</item>
<item name="children" xsi:type="array">
<item name="details" xsi:type="array">
<item name="component" xsi:type="string">Magento_Checkout/js/view/summary/item/details</item>
<item name="children" xsi:type="array">
<item name="thumbnail" xsi:type="array">
<item name="component" xsi:type="string">Magento_Checkout/js/view/summary/item/details/thumbnail</item>
<item name="displayArea" xsi:type="string">before_details</item>
</item>
<item name="subtotal" xsi:type="array">
<item name="component" xsi:type="string">Magento_Checkout/js/view/summary/item/details/subtotal</item>
<item name="displayArea" xsi:type="string">after_details</item>
</item>
<item name="message" xsi:type="array">
<item name="component" xsi:type="string">Magento_Checkout/js/view/summary/item/details/message</item>
<item name="displayArea" xsi:type="string">item_message</item>
</item>
</item>
</item>
</item>
</item>
<item name="summary" xsi:type="array">
<item name="component" xsi:type="string">Magento_Checkout/js/view/summary</item>
<item name="displayArea" xsi:type="string">summary</item>
<item name="config" xsi:type="array">
<item name="template" xsi:type="string">Magento_Checkout/summary</item>
</item>
<item name="children" xsi:type="array">
<item name="totals" xsi:type="array">
<item name="component" xsi:type="string">Magento_Checkout/js/view/summary/totals</item>
<item name="displayArea" xsi:type="string">totals</item>
<item name="config" xsi:type="array">
<item name="template" xsi:type="string">Magento_Checkout/summary/totals</item>
</item>
<item name="children" xsi:type="array">
<!-- sort order for this totals is configured on admin panel-->
<!-- Stores->Configuration->SALES->Sales->General->Checkout Totals Sort Order -->
<item name="subtotal" xsi:type="array">
<item name="component" xsi:type="string">Magento_Checkout/js/view/summary/subtotal</item>
<item name="config" xsi:type="array">
<item name="title" xsi:type="string" translate="true">Cart Subtotal</item>
</item>
</item>
<item name="shipping" xsi:type="array">
<item name="component" xsi:type="string">Magento_Checkout/js/view/summary/shipping</item>
<item name="config" xsi:type="array">
<item name="title" xsi:type="string" translate="true">Shipping</item>
<item name="notCalculatedMessage" xsi:type="string" translate="true">Not yet calculated</item>
</item>
</item>
<item name="grand-total" xsi:type="array">
<item name="component" xsi:type="string">Magento_Checkout/js/view/summary/grand-total</item>
<item name="config" xsi:type="array">
<item name="title" xsi:type="string" translate="true">Order Total</item>
</item>
</item>
</item>
</item>
<item name="itemsBefore" xsi:type="array">
<item name="component" xsi:type="string">uiComponent</item>
<item name="children" xsi:type="array">
<!-- merge your components here -->
</item>
</item>
<item name="itemsAfter" xsi:type="array">
<item name="component" xsi:type="string">uiComponent</item>
<item name="children" xsi:type="array">
<!-- merge your components here -->
</item>
</item>
</item>
</item>
<item name="shipping-information" xsi:type="array">
<item name="component" xsi:type="string">Magento_Checkout/js/view/shipping-information</item>
<item name="config" xsi:type="array">
<item name="deps" xsi:type="string">checkout.steps.shipping-step.shippingAddress</item>
</item>
<item name="displayArea" xsi:type="string">shipping-information</item>
<item name="children" xsi:type="array">
<item name="ship-to" xsi:type="array">
<item name="component" xsi:type="string">Magento_Checkout/js/view/shipping-information/list</item>
<item name="displayArea" xsi:type="string">ship-to</item>
</item>
</item>
</item>
</item>
</item>
</item>
</item>
<item name="paypal" xsi:type="array">
<item name="component" xsi:type="string">Magento_Checkout/js/view/paypal</item>
<item name="displayArea" xsi:type="string">paypal</item>
</item>
<item name="checkout-footer" xsi:type="array">
<item name="component" xsi:type="string">Magento_Checkout/js/view/checkout-footer</item>
<item name="displayArea" xsi:type="string">checkout-footer</item>
</item>
<item name="steps" xsi:type="array"> <item name="steps" xsi:type="array">
<item name="children" xsi:type="array"> <item name="children" xsi:type="array">
<item name="shipping-step" xsi:type="array"> <item name="shipping-step" xsi:type="array">
...@@ -59,18 +158,6 @@ ...@@ -59,18 +158,6 @@
</item> </item>
</item> </item>
</item> </item>
<item name="placeOrder" xsi:type="array">
<item name="component" xsi:type="string">Magento_Checkout/js/view/place-order</item>
<item name="displayArea" xsi:type="string">placeOrder</item>
</item>
<item name="security" xsi:type="array">
<item name="component" xsi:type="string">Magento_Checkout/js/view/security</item>
<item name="displayArea" xsi:type="string">security</item>
</item>
<item name="addressGet" xsi:type="array">
<item name="component" xsi:type="string">Magento_Checkout/js/view/address-get</item>
<item name="displayArea" xsi:type="string">addressGet</item>
</item>
</item> </item>
</item> </item>
</item> </item>
......
...@@ -18,40 +18,25 @@ $canApplyMsrp = $helper->isShowBeforeOrderConfirm($product) && $helper->isMinima ...@@ -18,40 +18,25 @@ $canApplyMsrp = $helper->isShowBeforeOrderConfirm($product) && $helper->isMinima
$objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$mobileDetect = $objectManager->get(\Joshine\Common\Lib\MobileDetect\MobileDetect::class); $mobileDetect = $objectManager->get(\Joshine\Common\Lib\MobileDetect\MobileDetect::class);
$priceBlock = $objectManager->get(\Magento\Catalog\Block\Product\AbstractProduct::class); $priceBlock = $objectManager->get(\Magento\Catalog\Block\Product\AbstractProduct::class);
$_options = $block->getOptionList();
$resource = $objectManager->get('Magento\Framework\App\ResourceConnection');
$connection = $resource->getConnection();
foreach ($_options as $key=>$_option) {
if ($_option['label'] != 'Size') {
$tableName = $resource->getTableName('eav_attribute_option_value');
$sql = "Select value FROM " . $tableName ." where store_id=0 AND option_id=".$_option['option_value'];
} else {
$tableName = $resource->getTableName('eav_attribute_option_swatch');
$sql = "Select value FROM " . $tableName ." where store_id=0 AND option_id=".$_option['option_value'];
}
$result = $connection->fetchRow($sql);
$_options[$key]['value'] = $result['value'];
}
?> ?>
<div class="cart item is_mobile"> <div class="cart item is_mobile">
<div class="item-info"> <div class="item-info">
<div class="item-info-left item-image"> <div class="item-info-left item-image">
<?php if ($block->hasProductUrl()) :?> <?php if ($block->hasProductUrl()) :?>
<a href="<?= $block->escapeUrl($block->getProductUrl()) ?>" <a href="<?= $block->escapeUrl($block->getProductUrl()) ?>"
title="<?= $block->escapeHtml($block->getProductName()) ?>" title="<?= $block->escapeHtml($block->getProductName()) ?>"
tabindex="-1" tabindex="-1"
class="product-item-photo"> class="product-item-photo">
<?php else :?> <?php else :?>
<span class="product-item-photo"> <span class="product-item-photo">
<?php endif;?> <?php endif;?>
<?= $block->getImage($block->getProductForThumbnail(), 'cart_page_product_thumbnail')->toHtml() ?> <?= $block->getImage($block->getProductForThumbnail(), 'cart_page_product_thumbnail')->toHtml() ?>
<?php if ($block->hasProductUrl()) :?> <?php if ($block->hasProductUrl()) :?>
</a> </a>
<?php else :?> <?php else :?>
</span> </span>
<?php endif; ?> <?php endif; ?>
</div> </div>
<div class="item-info-right item-info-detail"> <div class="item-info-right item-info-detail">
<!----------------------------item name start-----------------------------------> <!----------------------------item name start----------------------------------->
...@@ -66,18 +51,25 @@ foreach ($_options as $key=>$_option) { ...@@ -66,18 +51,25 @@ foreach ($_options as $key=>$_option) {
</p> </p>
<!----------------------------item name end-------------------------------------> <!----------------------------item name end------------------------------------->
<!----------------------------item option start---------------------------------> <!----------------------------item option start--------------------------------->
<?php if ($_options) :?> <?php if ($_options = $block->getOptionList()) :?>
<div class="item-options-meta"> <div class="item-options-meta">
<?php foreach ($_options as $key=>$_option) :?> <?php foreach ($_options as $_option) :?>
<strong style="font-weight: 600;margin-right: 10px;"><?= $block->escapeHtml($_option['label']) ?> :</strong>
<span class="item-options-line"> <span class="item-options-line">
<?= $block->escapeHtml($_option['value']) ?> <?php $_formatedOptionValue = $block->getFormatedOptionValue($_option) ?>
</span><br /> <strong style="font-weight: 600;margin-right: 10px;"><?= $block->escapeHtml($_option['label']) ?>:</strong>
<?php if (isset($_formatedOptionValue['full_view'])) :?>
<?= $block->escapeHtml($_formatedOptionValue['full_view']) ?>
<?php else :?>
<?= $block->escapeHtml($_formatedOptionValue['value'], ['span', 'a']) ?>
<?php endif; ?>
</span><br />
<?php endforeach; ?> <?php endforeach; ?>
</div> </div>
<?php endif;?> <?php endif;?>
<div style="max-width: 100%;width: 100%;height: 40px;"> <div style="max-width: 100%;width: 100%;height: 40px;">
<!----------------------------item handle start---------------------------------> <!----------------------------item handle start--------------------------------->
<div class="item-handle" style="width: 16%;float:left;position: inherit;font-size: 16px;"> <div class="item-handle" style="width: 16%;float:left;position: inherit;font-size: 16px;">
<div class="item-quantity"> <div class="item-quantity">
...@@ -114,14 +106,14 @@ foreach ($_options as $key=>$_option) { ...@@ -114,14 +106,14 @@ foreach ($_options as $key=>$_option) {
<!----------------------------item handle end-----------------------------------> <!----------------------------item handle end----------------------------------->
<!----------------------------item option end-----------------------------------> <!----------------------------item option end----------------------------------->
<div style="float: right;padding-right: 15%;width: 40%;font-size: 18px;"> <div style="float: right;padding-right: 15%;width: 40%;font-size: 18px;">
<?php if ($canApplyMsrp) :?> <?php if ($canApplyMsrp) :?>
<span class="cart msrp subtotal">--</span> <span class="cart msrp subtotal">--</span>
<?php else :?> <?php else :?>
<?= $block->getRowTotalHtml($_item) ?> <?= $block->getRowTotalHtml($_item) ?>
<?php endif; ?> <?php endif; ?>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
......
...@@ -2,11 +2,6 @@ ...@@ -2,11 +2,6 @@
$copyrightBlock = $block->getLayout()->createBlock('Magento\Theme\Block\Html\Footer'); $copyrightBlock = $block->getLayout()->createBlock('Magento\Theme\Block\Html\Footer');
?> ?>
<footer class="page-footer"> <footer class="page-footer">
<div data-block-id="shopping_footer_why_choose_us">
<div class="choose-us">
<?= __("WHY CHOOSE US") ?>
</div>
<?php echo $block->getLayout()->createBlock('Magento\Cms\Block\Block')->setBlockId('why_choose_us')->toHtml();?>
<div class="footer-mini-copyright-content"><?= $block->escapeHtml($copyrightBlock->getCopyright()) ?></div> <div class="footer-mini-copyright-content"><?= $block->escapeHtml($copyrightBlock->getCopyright()) ?></div>
</footer> </footer>
<script> <script>
......
...@@ -14,10 +14,27 @@ $full_free = $block->getFullFreeShip(); ...@@ -14,10 +14,27 @@ $full_free = $block->getFullFreeShip();
$_helper = $objectManager->get('Magento\Framework\Pricing\Helper\Data'); $_helper = $objectManager->get('Magento\Framework\Pricing\Helper\Data');
$full_free_ship = $_helper->currency($full_free, true, false); $full_free_ship = $_helper->currency($full_free, true, false);
$free_price = $_helper->currency(0, true, false); $free_price = $_helper->currency(0, true, false);
$logoUrl = $block->getLogoUrl();
$mobileDetect = $objectManager->get(\Joshine\Common\Lib\MobileDetect\MobileDetect::class);
$isMobile = $mobileDetect->isMobile();
?> ?>
<style type="text/css"> <style type="text/css">
.payment-method._active{ .trade_wrapper{
border: 1px solid #1979c3 !important; font-family: 'Helvetica Neue', Arial, sans-serif;
font-size:14px;
}
.main__header{
text-align: center;
font-size: 12px;
}
.payment-method:not(:last-child){
border-bottom: 1px solid #C2C2C2;
}
.payment-group{
background-color: #FFFFFF;
border-radius: 6px;
padding:15px;
} }
.checkout-index-index{ .checkout-index-index{
font-family: 'Outfit-Regular', sans-serif; font-family: 'Outfit-Regular', sans-serif;
...@@ -80,15 +97,11 @@ $free_price = $_helper->currency(0, true, false); ...@@ -80,15 +97,11 @@ $free_price = $_helper->currency(0, true, false);
.header.content .logo img{max-width: 60%;} .header.content .logo img{max-width: 60%;}
.payment-method-note{font-size: 12px;} .payment-method-note{font-size: 12px;}
} }
.checkout-index-index #maincontent{background: #f2f2f2;margin:0 auto;padding:0;}
.opc>li{
padding: 0px !important;
}
.checkout-index-index #maincontent{background: #f2f2f2;}
.page-title-wrapper{display: none;} .page-title-wrapper{display: none;}
#opc-sidebar{ #opc-sidebar{
background: #fff; background: #fff;
font-size: 16px; font-size: 14px;
} }
.opc-block-summary{ .opc-block-summary{
padding: 15px; padding: 15px;
...@@ -111,7 +124,6 @@ $free_price = $_helper->currency(0, true, false); ...@@ -111,7 +124,6 @@ $free_price = $_helper->currency(0, true, false);
font-weight: 600; font-weight: 600;
font-size: 20px; font-size: 20px;
cursor: pointer; cursor: pointer;
background: #eeeeee;
padding:15px; padding:15px;
} }
.label { .label {
...@@ -119,13 +131,16 @@ $free_price = $_helper->currency(0, true, false); ...@@ -119,13 +131,16 @@ $free_price = $_helper->currency(0, true, false);
font-size: 13px; font-size: 13px;
} }
.table-checkout-shipping-method tr.row{ .table-checkout-shipping-method tr.row{
border: 1px solid #dcdcdc; border-bottom: 1px solid #dcdcdc;
line-height: 10px; line-height: 10px;
display: block; display: block;
padding: 0 10px; padding: 0 10px;
margin-bottom: 10px; margin-bottom: 10px;
height: 50px; height: 50px;
} }
.table-checkout-shipping-method tr.row:last-child{
border-bottom:none;
}
a[href^="tel:"]{ a[href^="tel:"]{
color: #666666; color: #666666;
...@@ -206,20 +221,23 @@ $free_price = $_helper->currency(0, true, false); ...@@ -206,20 +221,23 @@ $free_price = $_helper->currency(0, true, false);
} }
.opc-block-summary .payment-option .form-discount .actions-toolbar .action{ .opc-block-summary .payment-option .form-discount .actions-toolbar .action{
background: #000000; background: #dbb893;
height: 38px; height: 38px;
} }
.opc-block-summary .payment-option .form-discount .actions-toolbar span:first-child{
display: inline-block;
padding: 0px 10px;
}
.actions-toolbar .secondary a.action.remind span{ .actions-toolbar .secondary a.action.remind span{
font-size: 14px; font-size: 14px;
font-family: Outfit-Regular; font-family: Outfit-Regular;
color: #000000; color: #000000;
} }
.opc .checkout-shipping-address{
padding-bottom: 20px;
}
table.table-checkout-shipping-method{ table.table-checkout-shipping-method{
border-collapse: separate; border-collapse: separate;
border-spacing: 5px 10px; border-spacing: 5px 10px;
background-color: #FFFFFF;
border-radius: 6px;
} }
.opc-summary-wrapper .shipping-information{ .opc-summary-wrapper .shipping-information{
display: none; display: none;
...@@ -228,18 +246,15 @@ $free_price = $_helper->currency(0, true, false); ...@@ -228,18 +246,15 @@ $free_price = $_helper->currency(0, true, false);
margin-top: 4px; margin-top: 4px;
} }
.payment-method{ .payment-method{
padding: 10px 20px; padding: 10px 0px;
margin-bottom: 20px;
border: 1px solid #dcdcdc;
height: 60px; height: 60px;
} }
.payment-method ._active{
border: 1px solid #1979c3;
}
.checkout-billing-address{ .checkout-billing-address{
font-size: 14px; font-size: 14px;
color: #666666; color: #666666;
margin-bottom: 10px; }
.checkout-billing-address .field-select-billing .control{
display:none!important;
} }
.authentication-wrapper{ .authentication-wrapper{
float: none; float: none;
...@@ -275,13 +290,9 @@ $free_price = $_helper->currency(0, true, false); ...@@ -275,13 +290,9 @@ $free_price = $_helper->currency(0, true, false);
} }
/****************************************payment begin********************************************************/ /****************************************payment begin********************************************************/
#checkout-step-shipping_method,.dispay-solid{ .dispay-solid{
display:none; display:none;
} }
#shipping-text{
display:none;
padding: 20px 0 25px;
}
.confirmed-address{ .confirmed-address{
width: 50%; width: 50%;
padding: 20px 22px; padding: 20px 22px;
...@@ -329,23 +340,6 @@ $free_price = $_helper->currency(0, true, false); ...@@ -329,23 +340,6 @@ $free_price = $_helper->currency(0, true, false);
height: 12px; height: 12px;
fill: #666; fill: #666;
} }
.opc .step-title, .opc .field-select-billing .label{
background: #ffffff;
border-bottom: 1px solid #dddddd;
}
.checkout-index-index .authentication-wrapper{
background: #ffffff;
padding:20px;
margin-bottom: 18px;
top:0;
}
.checkout-index-index .opc {
background-color: #f2f2f2;
}
.checkout-index-index .opc li {
background-color: #ffffff;
margin-bottom:1rem;
}
.no-border{ .no-border{
border-bottom:none!important; border-bottom:none!important;
} }
...@@ -386,9 +380,6 @@ $free_price = $_helper->currency(0, true, false); ...@@ -386,9 +380,6 @@ $free_price = $_helper->currency(0, true, false);
gap: 0rem; gap: 0rem;
position: relative; position: relative;
} }
.checkout-index-index .block.items-in-cart{
display: none;
}
.checkout-index-index table tr,.checkout-index-index table tr .mark .title{ .checkout-index-index table tr,.checkout-index-index table tr .mark .title{
border:none; border:none;
} }
...@@ -419,6 +410,7 @@ $free_price = $_helper->currency(0, true, false); ...@@ -419,6 +410,7 @@ $free_price = $_helper->currency(0, true, false);
.checkout-index-index .opc-block-summary .payment-option { .checkout-index-index .opc-block-summary .payment-option {
order:-7; order:-7;
border-top:1px solid #ddd;
} }
.checkout-index-index .opc-block-summary .payment-option .payment-option-content { .checkout-index-index .opc-block-summary .payment-option .payment-option-content {
padding: 1rem 0px; padding: 1rem 0px;
...@@ -444,6 +436,7 @@ $free_price = $_helper->currency(0, true, false); ...@@ -444,6 +436,7 @@ $free_price = $_helper->currency(0, true, false);
} }
.checkout-index-index .opc-block-summary .payment-option._active .payment-option-title { .checkout-index-index .opc-block-summary .payment-option._active .payment-option-title {
border-bottom: none; border-bottom: none;
display:none;
} }
.checkout-cart-index .opc-estimated-wrapper .minicart-wrapper { .checkout-cart-index .opc-estimated-wrapper .minicart-wrapper {
display: none; display: none;
...@@ -463,6 +456,12 @@ $free_price = $_helper->currency(0, true, false); ...@@ -463,6 +456,12 @@ $free_price = $_helper->currency(0, true, false);
margin-left: 5px; margin-left: 5px;
} }
/***************payment start******************/ /***************payment start******************/
.checkout-index-index .authentication-wrapper{
background: #ffffff;
padding:20px;
margin-bottom: 18px;
top:0;
}
.confirmed-address{ .confirmed-address{
width: 100%; width: 100%;
border-bottom: none; border-bottom: none;
...@@ -473,31 +472,31 @@ $free_price = $_helper->currency(0, true, false); ...@@ -473,31 +472,31 @@ $free_price = $_helper->currency(0, true, false);
bottom:0; bottom:0;
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAu4AAAAGCAYAAACclRsMAAABWklEQVR4nO3aMUrEQBiG4VfxAnoHwWZ7e1GsrAQ9gkIKDxPQI2hrJSvb29sIXsBKLyAoWbbLDCZuZvlD3qfaIgn59vsnTDFbHzfnP5TxBVxWs3re8em7wD1wUuh9SlnmBOb1azWJnD3uGXVWZ7dlKrM7+pzVrO56j7Mb26Rm129ui/uF+DY+uzuF/pJ34Kya1W8dr98HHoGDQu9TyjInYM62UWd1dlvMGdvk1qidtvjNjc25zXN2e9geMsHKAjjsUdoR8DLCwsyZZ6exmTPNNRqfnaaZMzZz5tlpT0Nv3O+AU+Cz4/VXwBOwN/B7lGbOPDuNzZxprtH47DTNnLGZM89O/2Gojfs30BzYul79/ktzRKc5hHlb8LhOCebMs9PYzJnmGo3PTtPMGZs58+x0DUM8qDmYfwE8d7y+OZj/ABwPFWJDzJlnp7GZM801Gp+dppkzNnPm2ek6gF8O5wurSKfLHQAAAABJRU5ErkJggg==) repeat-x; background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAu4AAAAGCAYAAACclRsMAAABWklEQVR4nO3aMUrEQBiG4VfxAnoHwWZ7e1GsrAQ9gkIKDxPQI2hrJSvb29sIXsBKLyAoWbbLDCZuZvlD3qfaIgn59vsnTDFbHzfnP5TxBVxWs3re8em7wD1wUuh9SlnmBOb1azWJnD3uGXVWZ7dlKrM7+pzVrO56j7Mb26Rm129ui/uF+DY+uzuF/pJ34Kya1W8dr98HHoGDQu9TyjInYM62UWd1dlvMGdvk1qidtvjNjc25zXN2e9geMsHKAjjsUdoR8DLCwsyZZ6exmTPNNRqfnaaZMzZz5tlpT0Nv3O+AU+Cz4/VXwBOwN/B7lGbOPDuNzZxprtH47DTNnLGZM89O/2Gojfs30BzYul79/ktzRKc5hHlb8LhOCebMs9PYzJnmGo3PTtPMGZs58+x0DUM8qDmYfwE8d7y+OZj/ABwPFWJDzJlnp7GZM801Gp+dppkzNnPm2ek6gF8O5wurSKfLHQAAAABJRU5ErkJggg==) repeat-x;
} }
.checkout-index-index .opc-estimated-wrapper,.checkout-index-index .page-wrapper .page-header{background: #ffffff;}
.checkout-index-index .page-wrapper .page-header{ .checkout-index-index .page-wrapper .page-header{
border-bottom:1px solid #ddd; border-bottom:1px solid #ddd;
} }
.checkout-index-index .opc>li{ .checkout-index-index .opc>li{
padding: 5px !important; padding: 0;
} }
.checkout-index-index .opc .step-title, .checkout-index-index .opc .field-select-billing .label { .checkout-index-index .opc .step-title, .checkout-index-index .opc .field-select-billing .label {
padding-left: 5px; padding-left: 5px;
} }
.checkout-index-index .opc .step-title { .checkout-index-index #checkout-payment-method-load
padding: 1rem 0px; {
padding:0.2rem 0 0.5rem;
} }
.checkout-index-index #checkout-payment-method-load,.checkout-index-index #checkout-step-shipping .checkout-index-index #checkout-step-shipping
{ {
padding:1rem 0 0.5rem; padding:1rem 0 0.5rem;
} }
.checkout-index-index #checkout-step-shipping_method .checkout-index-index #checkout-step-shipping_method
{ {
padding-top:1rem; padding:1rem 0px;
} }
.checkout-index-index #opc-sidebar{ .checkout-index-index #opc-sidebar{
border:none; border:none;
margin-bottom: 0px; margin-bottom: 0px;
font-size: 16px !important font-size: 14px !important
} }
.checkout-index-index .opc .actions-toolbar.action-update-cancel { .checkout-index-index .opc .actions-toolbar.action-update-cancel {
position: relative; position: relative;
...@@ -514,9 +513,7 @@ $free_price = $_helper->currency(0, true, false); ...@@ -514,9 +513,7 @@ $free_price = $_helper->currency(0, true, false);
.checkout-index-index .page-wrapper a.logo{ .checkout-index-index .page-wrapper a.logo{
margin-left: 0px!important; margin-left: 0px!important;
} }
.checkout-index-index div#checkout {
margin-top: 1rem;
}
.checkout-index-index .authentication-wrapper{ .checkout-index-index .authentication-wrapper{
padding: 5px 20px; padding: 5px 20px;
border-bottom: 1px solid #ddd; border-bottom: 1px solid #ddd;
...@@ -537,25 +534,28 @@ $free_price = $_helper->currency(0, true, false); ...@@ -537,25 +534,28 @@ $free_price = $_helper->currency(0, true, false);
} }
.checkout-index-index .block.items-in-cart{ .checkout-index-index .block.items-in-cart{
border-bottom: 1px solid #ddd; border-top: 1px solid #ddd;
background-color: #fff; background-color: #FFFFFF;
margin-bottom: 1rem;
padding: 0.35rem 0rem;
display: block; display: block;
} }
.checkout-index-index .block.items-in-cart .title{ .checkout-index-index .block.items-in-cart .title{
padding-left:1rem; padding-left:1rem;
background-color: #EBE5E1;
line-height: 2rem;
} }
.checkout-index-index .block.items-in-cart .title strong{ .checkout-index-index .block.items-in-cart .title strong{
width:100%; width:100%;
font-size:14px;
font-weight: 400;
} }
.checkout-index-index .block.items-in-cart .title strong .estimated-label{ .checkout-index-index .block.items-in-cart .title strong .estimated-label{
width: 50%; color:#276EAF;
}
.checkout-index-index .block.items-in-cart .title strong .estimated-label,.checkout-index-index .block.items-in-cart .title strong .estimated-price{
width: 42%;
display: inline-block; display: inline-block;
} }
.checkout-index-index .block.items-in-cart .title strong .estimated-price{ .checkout-index-index .block.items-in-cart .title strong .estimated-price{
width: 45%;
display: inline-block;
text-align: right; text-align: right;
} }
.checkout-index-index #opc-sidebar .table-totals .totals.discount .amount .price{ .checkout-index-index #opc-sidebar .table-totals .totals.discount .amount .price{
...@@ -573,38 +573,84 @@ $free_price = $_helper->currency(0, true, false); ...@@ -573,38 +573,84 @@ $free_price = $_helper->currency(0, true, false);
.checkout-index-index .opc .actions-toolbar { .checkout-index-index .opc .actions-toolbar {
display:none!important; display:none!important;
} }
.opc .step-title{ .opc .step-title,.contact-title{
font-size: 25px; font-size: 18px;
padding: 0; font-weight: 400;
line-height: 1; line-height: 21px;
margin: 0; margin: 0.5rem 0px;
font-weight:normal; word-break: break-word;
color: #2c2c2c;
font-family: Helvetica Neue, Arial,sans-serif;
padding:0;
} }
.actions-toolbar .font-action{ .actions-toolbar .font-action{
vertical-align: super; vertical-align: super;
} }
@media(min-width:768px){ .checkout-index-index #next-shipping > span{
font-size: 16px;
.authentication-wrapper .login-q-reg { background: #dbb893;
font-size: 16px; color: rgb(44, 44, 44);
color: #515151; height: auto;
font-weight: 700; min-height: 40px;
padding: 10px 30px;
text-transform: none;
border-radius: 4px;
line-height: 40px;
}
.checkout-index-index #next-shipping{
position: relative;
min-height: 60px;
font-family: Helvetica Neue, Arial,sans-serif;
font-size: 14px;
}
.checkout-index-index .handle-btn{
position: absolute;
left:0;
top:30%;
color:#276EAF;
cursor: pointer;
background: none;
}
.checkout-index-index .handle-btn .svg-left{
display: inline-block;
-webkit-transform: rotate(90deg);
-moz-transform: rotate(90deg);
-o-transform: rotate(90deg);
transform: rotate(90deg);
}
@media(min-width:768px){
.opc {
background: none;
} }
.action.action-auth-toggle { .action.action-auth-toggle {
text-transform: capitalize; text-transform: capitalize;
margin-left: 15px; margin-left: 15px;
} }
.opc>li{ .opc>li{
padding: 20px !important; padding:0;
}
.opc .checkout-shipping-address{
margin-top: 2rem;
} }
#checkout .payment-left{ #checkout .payment-left{
width:66%; -webkit-box-orient: vertical;
float:left; -webkit-box-direction: normal;
-webkit-box-flex: 0;
display: flex;
flex: 0 0 58%;
flex-direction: column;
padding-right: 6%;
} }
#checkout .payment-right{ #checkout .payment-right{
width:31%; -webkit-box-flex: 0;
float:right; background-position: 0px 0px;
flex: 0 0 42%;
padding-left: 4%;
padding-top: 56px;
overflow: hidden;
z-index:1;
} }
#checkout .opc-wrapper { #checkout .opc-wrapper {
float: none; float: none;
...@@ -633,7 +679,7 @@ $free_price = $_helper->currency(0, true, false); ...@@ -633,7 +679,7 @@ $free_price = $_helper->currency(0, true, false);
padding:10px 0 25px; padding:10px 0 25px;
} }
#checkout-payment-method-load{ #checkout-payment-method-load{
padding:20px 0 25px; padding:5px 0 25px;
} }
.opc .actions-toolbar.action-update-cancel .opc .actions-toolbar.action-update-cancel
{ {
...@@ -642,32 +688,95 @@ $free_price = $_helper->currency(0, true, false); ...@@ -642,32 +688,95 @@ $free_price = $_helper->currency(0, true, false);
.checkout-index-index .payment-method._active .actions-toolbar .action span:last-child{ .checkout-index-index .payment-method._active .actions-toolbar .action span:last-child{
vertical-align: super; vertical-align: super;
} }
.checkout-index-index .save-continue{
position: absolute;
right:0;
bottom:0;
}
.checkout-index-index #next-shipping > span:hover::before {
background: rgb(0, 0, 0);
border-radius: 4px;
content: "";
height: 100%;
left: 0px;
opacity: 0.2;
position: absolute;
top: 0px;
width: 100%;
z-index: 1;
}
} }
@media (min-width: 1024px) { @media (min-width: 1024px) {
main#maincontent { main#maincontent {
width: 100% !important; width: 100% !important;
} }
.checkout-container{
width: 65%;
margin: 0 auto;
/*background: #ffffff;
padding: 20px;*/
}
li#opc-shipping_method { li#opc-shipping_method {
margin-top: 10px; margin-top: 10px;
} }
.payment-method-title.field.choice label.label span { .payment-method-title.field.choice label.label span {
width: 40%; width: 40%;
float: right; float: right;
font-size: 18px; font-size: 14px;
} }
.payment-method-title.field.choice label.label { .payment-method-title.field.choice label.label {
width: 100%; width: 100%;
} }
.content.content_wrapper {
display: -webkit-box;
display: -webkit-flex;
display: -moz-box;
display: flex;
-webkit-box-flex: 1;
-moz-box-flex: 1;
-webkit-flex-grow: 1;
flex-grow: 1;
}
.right-fill{
width: -webkit-calc(50% - 88px);
width: -moz-calc(50% - 88px);
width: calc(50% - 88px);
}
.trade_wrapper {
max-width: 1100px;
-webkit-box-flex: 1;
flex-grow: 1;
}
}
.checkout-container{
margin: 0 auto;
width:100%;
background: #EEE7E3;
min-height: 100vh;
}
.trade_checkout .content {
-webkit-box-orient: horizontal;
-webkit-box-direction: normal;
-moz-box-orient: horizontal;
-moz-box-direction: normal;
-webkit-flex-direction: row;
flex-direction: row;
font-size: 14px;
line-height: 1.4;
} }
table tbody:last-child tr:last-child { .right-fill{
border-bottom: 1px solid #dcdcdc !important; background: #FAFAFA;
background-image: url();
border-left: 1px solid rgba(44, 44, 44, 0.04);
height: 100%;
position: fixed;
right: 0;
top: 0;
z-index: 0;
}
.trade_wrapper{
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
zoom: 1;
display: flex;
flex-direction: row;
margin: 0px auto;
} }
.teliphone_number{width:100% !important;} .teliphone_number{width:100% !important;}
#checkout_security_guarantee span{ #checkout_security_guarantee span{
...@@ -692,15 +801,83 @@ $free_price = $_helper->currency(0, true, false); ...@@ -692,15 +801,83 @@ $free_price = $_helper->currency(0, true, false);
padding: 10px 0px; padding: 10px 0px;
transition: all .3s; transition: all .3s;
} }
.checkout-index-index .trade_checkout__exp__title{
-webkit-box-pack: center;
-moz-box-pack: center;
-webkit-box-align: center;
-moz-box-align: center;
-webkit-align-items: center;
align-items: center;
display: -webkit-box;
display: -webkit-flex;
display: -moz-box;
display: flex;
font-size: 14px;
font-weight: 400;
-webkit-justify-content: center;
justify-content: center;
margin: 0;
text-align: center;
width: 100%;
}
.checkout-index-index .trade_checkout__exp__line{
-webkit-box-pack: center;
-moz-box-pack: center;
-webkit-box-align: center;
-moz-box-align: center;
-webkit-align-items: center;
align-items: center;
color: #2c2c2c;
display: -webkit-box;
display: -webkit-flex;
display: -moz-box;
display: flex;
-webkit-justify-content: center;
justify-content: center;
}
.trade-checkout-whole-footer__baseline,
.trade_checkout__exp__line .lineLeft,
.trade_checkout__exp__line .lineRight,
.trade_checkout__exp__title:after,
.trade_checkout__exp__title:before {
background: rgba(44, 44, 44, 0.15);
}
.trade_checkout__exp__title:before {
margin-right: 12px;
}
.trade_checkout__exp__title:after, .trade_checkout__exp__title:before {
-webkit-box-flex: 1;
-moz-box-flex: 1;
content: "";
-webkit-flex: 1 0 16px;
flex: 1 0 16px;
height: 1px;
min-width: 24px;
}
.trade_checkout__exp__line .lineLeft, .trade_checkout__exp__line .lineRight {
-webkit-box-flex: 1;
-moz-box-flex: 1;
display: inline-block;
-webkit-flex: 1 1 1%;
flex: 1 1 1%;
height: 1px;
min-width: 24px;
}
.checkout-index-index .checkout-logo-medium{
border-radius: 5px;
margin:5px 0px 10px;
}
.checkout-index-index .checkout-logo-medium a{
width:100%;
display: inline-block;
text-align: center;
}
@media(min-width: 1024px){ @media(min-width: 1024px){
.opc .actions-toolbar{ .opc .actions-toolbar{
position: absolute; position: absolute;
bottom: 0px; bottom: 0px;
margin-left: 30%; margin-left: 30%;
} }
div#checkout-payment-method-load{
margin-bottom: 100px;
}
.payment-method div.payment_logo_oceanpaymentklarna{ .payment-method div.payment_logo_oceanpaymentklarna{
margin-top: -1% !important; margin-top: -1% !important;
} }
...@@ -816,8 +993,8 @@ $free_price = $_helper->currency(0, true, false); ...@@ -816,8 +993,8 @@ $free_price = $_helper->currency(0, true, false);
.payment-method-title label.label { .payment-method-title label.label {
width: 100%; width: 100%;
} }
table tbody:last-child tr:last-child { .checkout-index-index .opc-block-summary .payment-option {
border-bottom: 1px solid #dcdcdc !important; border-top: none;
} }
} }
/************************************* top logo style start******************************************************/ /************************************* top logo style start******************************************************/
...@@ -887,29 +1064,53 @@ $free_price = $_helper->currency(0, true, false); ...@@ -887,29 +1064,53 @@ $free_price = $_helper->currency(0, true, false);
.checkout-index-index .page-header .header.content .logo{ .checkout-index-index .page-header .header.content .logo{
left:35%; left:35%;
} }
.checkout-index-index .form-shipping-address{ #opc-sidebar{
margin-top:2rem; background: none;
}
.checkout-index-index .label-title{
position:relative;
margin:30px 0px 0px;
}
.checkout-index-index .contact-title{
line-height: 30px;
}
.checkout-index-index .authentication-wrapper{
position:absolute;
top:0;
right:0;
}
.checkout-index-index .login-q-reg{
font-size: 14px;
font-weight: 400;
color: #5d5b5a;
font-family: Helvetica Neue, Arial,sans-serif;
}
.checkout-index-index .authentication-wrapper .action.action-auth-toggle{
color:#0000ff!important;
} }
} }
.checkout-index-index #shipping .field.street {
.checkout-index-index #shipping .field.street,.checkout-index-index .billing-address-form .field.street {
min-height:7rem; min-height:7rem;
} }
.checkout-index-index #shipping .field.street .field.additional .control input[type="text"] { .checkout-index-index #shipping .field.street .field.additional .control input[type="text"],
.checkout-index-index .billing-address-form .field.street .field.additional .control input[type="text"]
{
padding:0; padding:0;
} }
.checkout-index-index #shipping .field.street .control{ .checkout-index-index #shipping .field.street .control,.checkout-index-index .billing-address-form .field.street .control{
border:none; border:none;
} }
.checkout-index-index #shipping .field.street .control .field .control{ .checkout-index-index #shipping .field.field-select-billing .control.checkout-index-index .billing-address-form .field.field-select-billing .control{
border: 1px solid #ddd;
}
.checkout-index-index #shipping .field.field-select-billing .control{
border:none; border:none;
} }
.checkout-index-index .opc .field-select-billing .label{ .checkout-index-index .opc .field-select-billing .label{
border-bottom: none; border-bottom: none;
} }
.checkout-index-index .select-style{ .checkout-index-index .select-style{
height:3rem; height:3rem;
z-index:2; z-index:2;
...@@ -922,10 +1123,6 @@ $free_price = $_helper->currency(0, true, false); ...@@ -922,10 +1123,6 @@ $free_price = $_helper->currency(0, true, false);
.checkout-index-index .select-input{ .checkout-index-index .select-input{
cursor: pointer; cursor: pointer;
} }
.fieldset.address .check-select{
z-index:2;
display:none;
}
.checkout-index-index #customer-password{ .checkout-index-index #customer-password{
height: 50px; height: 50px;
outline: none; outline: none;
...@@ -933,16 +1130,15 @@ $free_price = $_helper->currency(0, true, false); ...@@ -933,16 +1130,15 @@ $free_price = $_helper->currency(0, true, false);
padding: 18px 0 0; padding: 18px 0 0;
border: none; border: none;
color: #515151; color: #515151;
background: 0 0;
} }
/************************************* top logo style end******************************************************/ /************************************* top logo style end******************************************************/
/********************************************address from end****************************************************/ /********************************************address from end****************************************************/
#shipping .field{ #shipping .field,.billing-address-form .field{
position: relative; position: relative;
} }
#shipping .field .label{ #shipping .field .label,.billing-address-form .field .label{
position: absolute; position: absolute;
z-index: 1; z-index: 1;
top:15px; top:15px;
...@@ -951,9 +1147,9 @@ $free_price = $_helper->currency(0, true, false); ...@@ -951,9 +1147,9 @@ $free_price = $_helper->currency(0, true, false);
margin-left:0.5rem; margin-left:0.5rem;
} }
#shipping .field .control { #shipping .field .control,.billing-address-form .field .control{
height:50px; height:48px;
border:1px solid #ddd; background-color: #FFFFFF;
} }
#shipping .field.required .label::before, #shipping .field._required .label::before { #shipping .field.required .label::before, #shipping .field._required .label::before {
content: '*'; content: '*';
...@@ -966,17 +1162,336 @@ $free_price = $_helper->currency(0, true, false); ...@@ -966,17 +1162,336 @@ $free_price = $_helper->currency(0, true, false);
/*position: static;*/ /*position: static;*/
vertical-align: middle; vertical-align: middle;
} }
#shipping .field .control input[type="text"],#maincontent input[type="email"] { #shipping .field .control input[type="text"],#maincontent input[type="email"],.billing-address-form .field .control input[type="text"] {
height: 50px; height: 46px;
outline: none; outline: none;
text-indent: 10px; text-indent: 10px;
padding: 18px 0 0; padding: 18px 0 0;
border: none; border: none;
color: #515151; color: #2C2C2C;
background: 0 0; background-color:#FFFFFF;
font-size: 14px;
}
.checkout-index-index #customer-email-fieldset .field{
position: relative;
}
.checkout-index-index #customer-email-fieldset .field .label{
position: absolute;
z-index: 1;
top:15px;
line-height: 18px;
transition: all .3s ease;
margin-left:0.5rem;
}
.checkout-index-index .pc_logo {
display: block;
}
.logo_container.align-center, .logo_container.align-right {
-webkit-box-pack: center;
-moz-box-pack: center;
-webkit-justify-content: center;
justify-content: center;
}
.logo_container.align-center {
margin-bottom: 24px;
}
.can_click {
cursor: pointer;
}
.logo_container {
display: -webkit-box;
display: -webkit-flex;
display: -moz-box;
display: flex;
font-size: 1rem;
margin: 56px 0 24px;
}
.logo_container .logo_inner {
-webkit-box-align: center;
-moz-box-align: center;
-webkit-align-items: center;
align-items: center;
cursor: default;
display: -webkit-box;
display: -webkit-flex;
display: -moz-box;
display: flex;
position: relative;
}
.logo_container .logo_inner.size-medium img {
height: 40px;
}
.logo_container .logo_inner img {
max-width: 100%;
object-fit: contain;
}
.trade_checkout .main .trade-checkout-btn {
max-width: 100%;
width: auto;
}
.trade_checkout_breadcrumb .trade_checkout_step_done {
color: rgb(39, 110, 175);
cursor: pointer;
font-weight: 400;
transition: color 0.2s ease-in-out 0s;
}
.trade_checkout_breadcrumb .trade_checkout_breadcrumb_button {
appearance: none;
background-color: transparent;
border: 0px;
padding: 0px;
}
[type="reset"], [type="submit"], button, html [type="button"] {
appearance: button;
}
.custom-link-color {
color: #276EAF;
transition: color 0.2s ease-in-out 0s;
opacity: 1 !important;
opacity: 1!important;
-webkit-transition: color .2s ease-in-out;
-o-transition: color .2s ease-in-out;
-moz-transition: color .2s ease-in-out;
transition: color .2s ease-in-out;
}
.trade_checkout_breadcrumb .trade_checkout_breadcrumb_button .trade_checkout_steps_stepItem {
-webkit-box-align: center;
align-items: center;
display: flex;
line-height: 18px;
}
.trade_checkout_breadcrumb .trade_checkout_breadcrumb_button .trade_checkout_steps_stepItem span {
-webkit-box-flex: 1;
flex: 1 1 0%;
text-align: left;
word-break: break-word;
}
.trade_checkout_breadcrumb .trade_checkout_step_waiting {
font-weight: 400;
opacity: 0.6;
color: rgb(93, 91, 90);
}
.trade_checkout__exp__line .lineText {
font-size: 12px;
padding: 0px 20px;
text-align: center;
word-break: break-word;
}
.checkout_policy_description {
margin-bottom: 24px;
background: none;
} }
#shipping .fouse-label{ .checkout_policy_description ul {
list-style-type: none;
overflow: hidden;
}
.checkout_policy_description ul li {
cursor: pointer;
float: left;
font-size: 12px;
margin-bottom: 12px;
margin-right: 16px;
}
.trade-checkout-whole-footer__baseline {
height: 1px;
width: 100%;
}
.sl_section--small {
margin-bottom: 20px;
}
.trade_info-preview {
-webkit-border-radius: 6px;
-moz-border-radius: 6px;
border-radius: 6px;
padding: 0 16px;
border: 1px solid rgba(44, 44, 44, 0.15);
background: #fff;
color: #2c2c2c;
}
.confirmed-address{
width:100%;
padding: 20px 22px;
border: 1px solid #d6d6d6;
font-size: 14px;
/*min-height: 200px;*/
position: relative;
box-sizing: border-box;
}
.confirmed-address:before {
width: 0;
content: "";
}
.mian-text-line {
border-bottom: 1px solid rgba(44, 44, 44, 0.08);
}
.trade_info-preview-item {
-webkit-box-pack: justify;
-moz-box-pack: justify;
display: -webkit-box;
display: -webkit-flex;
display: -moz-box;
display: flex;
-webkit-justify-content: space-between;
justify-content: space-between;
padding: 12px 0;
}
.trade_info-preview-item_content {
-webkit-box-flex: 1;
-moz-box-flex: 1;
display: -webkit-box;
display: -webkit-flex;
display: -moz-box;
display: flex;
-webkit-flex: 1;
flex: 1;
}
.trade_info-preview-item_label {
margin-right: 16px;
width: 80px;
}
.trade_info-preview-item_label, .trade_info-preview-item_text {
font-size: 14px;
word-break: break-word;
}
.trade_info-preview-item_button {
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
background-color: transparent;
border: 0;
cursor: pointer;
display: -webkit-box;
display: -webkit-flex;
display: -moz-box;
display: flex;
font-size: 12px;
font-weight: 400;
line-height: 20px;
margin-left: 16px;
max-width: 100px;
outline: none;
padding: 0;
text-align: left;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
word-break: break-word;
justify-content: normal;
align-items: normal;
}
.trade_info-preview-item_button {
max-width: 120px;
}
.joshine-section{
margin-bottom: 20px;
}
.block-select-subtitle {
font-size: 12px;
font-weight: 400;
word-break: break-word;
color:#5D5B5A;
padding:0;
margin:0 auto;
}
#checkoutSteps{
display: grid;
}
.trade_info-preview-item_text .price{
font-weight: 600;
margin-left: 10px;
}
.email-note{
display: inline-block;
margin-top:10px;
}
#customer-email-fieldset .field.required > .label::after,
.field._required > .label::after {
content: '';
}
#customer-email-fieldset .field.required > .label::before,
.field._required > .label::before {
content: '*';
color: rgba(var(--danger-color), var(--danger-alpha, 1));
}
.checkout-index-index .fieldset.address select{
position:absolute;
bottom: 0;
padding: 3px 2.5rem 3px 12px;
border: none
}
select:-internal-autofill-previewed,
select:-internal-autofill-selected {
transition: background-color 5000s ease-out 0.5s;
}
input:-internal-autofill-previewed,
input:-internal-autofill-selected {
transition: background-color 5000s ease-out 0.5s;
}
.checkout-index-index .select{
height:28px;
}
.checkout-index-index .minicart-items-wrapper > .minicart-items {
max-height: 38rem;
padding-top:10px;
}
.checkout-index-index .minicart-items .product-image-container {
position: relative;
}
.checkout-index-index .minicart-items .details-qty {
width: 20px;
height: 20px;
border-radius: 50%;
text-align: center;
position: absolute;
top: -10px;
right: -10px;
color: #FFFFFF;
background-color: #747474;
font-size: 12px;
}
.opc-block-summary{
padding:0;
}
.minicart-items li.product-item + li{
padding-top: 0;
border:none;
}
.checkout-index-index .minicart-items li.product-item > div.product{
height:130px;
}
.minicart-items .product-item-name-block{
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
overflow:hidden;
/*! autoprefixer: off */
-webkit-box-orient: vertical;
}
.fouse-label{
top:5px!important; top:5px!important;
font-size: 14px;
transform: scale(0.8);
} }
.pleaseWait{ .pleaseWait{
transition: all .3s ease; transition: all .3s ease;
...@@ -987,22 +1502,208 @@ $free_price = $_helper->currency(0, true, false); ...@@ -987,22 +1502,208 @@ $free_price = $_helper->currency(0, true, false);
padding: 0!important; padding: 0!important;
} }
.checkout-index-index .table-totals td, .checkout-index-index .table-totals th { .checkout-index-index .table-totals td, .checkout-index-index .table-totals th {
padding: 0.1rem 0.5rem; padding: 0.3rem 0.5rem;
}
.checkout-index-index .table-totals tr:nth-last-child(2) td,.checkout-index-index .table-totals tr:nth-last-child(2) th{
padding-bottom: 1rem;
}
.checkout-index-index .table-totals .totals td{
text-align: right;
}
.checkout-index-index .table-totals .grand.totals td.mark{
text-align: left;
} }
.checkout-index-index .table-totals .grand.totals td{ .checkout-index-index .table-totals .grand.totals td{
padding:0.45rem; padding:1rem 0.45rem 0.45rem;
}
.checkout-cart-index table .grand.totals strong, .checkout-index-index table .grand.totals strong{
font-weight: normal;
} }
.checkout-index-index .table-totals .subtotal.totals td,.checkout-index-index .table-totals .subtotal.totals th{
padding-top:0.8rem;
}
.trade_checkout_steps_stepItem svg {
height: 16px;
margin: 0px 2px;
width: 16px;
}
@media(max-width:768px){
.trade_wrapper{
display: grid;
}
.checkout-index-index div#checkout{
margin-top: 0;
}
.right-fill{
display:none;
}
.logo_container {
-webkit-box-pack: center;
justify-content: center;
margin: 24px auto;
max-width: 568px;
cursor: pointer;
display: flex;
font-size: 1rem;
}
.logo_container .logo_inner.size-medium img{
width:120px;
}
.checkout-index-index .minicart-items-wrapper > .minicart-items{
overflow: visible;
}
.minicart-items li.product-item > div.product > :nth-child(2){
max-width: 60%;
}
#trade-checkout-smartpay,.email-box.address-one,.opc-wrapper,.copyright_block,.minicart-items,.opc-block-summary{
padding:0px 16px;
}
.checkout-index-index .checkout-logo-medium {
height: 55px;
}
.joshine-section {
margin-bottom: 5px;
margin-top: 20px;
}
.authentication-wrapper{
font-size: 14px;
}
.checkout-index-index .authentication-wrapper{
padding:0!important;
border:none;
background: none;
margin: 5px 0px 10px;
}
.action.action-auth-toggle {
line-height: 16px;
padding:0;
text-transform: none;
color:#276EAF;
font-size: 14px;
text-decoration:none;
font-family: 'Helvetica Neue', Arial, sans-serif;
}
.email-note{
margin-top:5px;
}
#checkoutSteps{
background: none;
}
.fieldset.address > .field {
width: 100%;
}
.field ._with-tooltip .field-tooltip{
top:30%;
}
.checkout-index-index #next-shipping {
display: grid;
margin:0 auto;
}
.checkout-index-index #next-shipping > span{
min-height: 68px;;
order:1;
margin-top:0px;
}
.checkout-index-index #next-shipping > span > span{
vertical-align: sub;
}
.checkout-index-index .handle-btn {
position: static;
order:2;
}
.checkout_policy_description {
margin:0 auto;
padding:0;
}
.sl_section--small {
margin-bottom: 10px;
padding:0px 16px;
}
.checkout-index-index .opc>li {
margin-top: 5px;
}
.opc .step-title{
margin:10px 0px 0px;
}
.trade_info-preview-item_content{
display: block;
width:100%;
}
.checkout-billing-address {
margin-top: 10px;
margin-bottom: 15px;
}
.opc-block-summary{
display:none;
}
.checkout-index-index .table-totals .grand.totals td{
padding:1rem 0.45rem 1rem;
}
.checkout-index-index table .grand.totals strong {
font-weight: 400;
font-size: 18px;
}
.checkout-index-index table .grand.totals,.checkout-index-index .opc-block-summary .payment-option{
border-top:1px solid #ddd;
}
#opc-sidebar {
box-shadow: none;
}
.checkout-index-index .bottom-border {
border-bottom: 1px solid #ddd;
}
}
#login-email{
border: 1px solid #ddd!important;
height: 40px!important;
padding: 5px!important;
}
.checkout-logo-medium input {
height: 40px;
}
.group-item-body {
padding: 16px;
font-size: 14px;
text-align: center;
color: #969696;
background: #f2f2f2;
margin-top: 15px;
}
#policy-description li a{
font-size: 12px;
color: #276EAF;
}
.jkl{
width:17px;
height:17px;
border:2px solid #f2f2f2;
border-top-color:#dbb893;
border-radius:50%;
animation: fadenum 1s linear infinite;
-moz-animation: fadenum 1s linear infinite;
-webkit-animation: fadenum 1s linear infinite;
-o-animation: fadenum 1s linear infinite;
vertical-align: sub;
display: inline-block;
margin-left:15px;
}
.wait-loop{
display: inline-block;
}
@keyframes fadenum{
100%{transform:rotate(360deg);}
}
/********************************************address from end****************************************************/ /********************************************address from end****************************************************/
</style> </style>
<div id="checkout" data-bind="scope:'checkout'" class="checkout-container"> <div id="checkout" data-bind="scope:'checkout'" class="checkout-container">
<div id="checkout-loader" data-role="checkout-loader" class="loading-mask" data-mage-init='{"checkoutLoader": {}}'>
<div class="loader">
<img src="<?= $block->escapeUrl($block->getViewFileUrl('images/loader-1.gif')) ?>"
alt="<?= $block->escapeHtmlAttr(__('Loading...')) ?>">
</div>
</div>
<?= /* @noEscape */ $secureRenderer->renderStyleAsTag("position: absolute;", "#checkout-loader img") ?>
<!-- ko template: getTemplate() --><!-- /ko --> <!-- ko template: getTemplate() --><!-- /ko -->
<script type="text/x-magento-init"> <script type="text/x-magento-init">
{ {
...@@ -1017,6 +1718,11 @@ $free_price = $_helper->currency(0, true, false); ...@@ -1017,6 +1718,11 @@ $free_price = $_helper->currency(0, true, false);
window.checkoutConfig.flatrate_price = '{$flatraPrice}'; window.checkoutConfig.flatrate_price = '{$flatraPrice}';
window.checkoutConfig.full_free_ship = '{$full_free_ship}'; window.checkoutConfig.full_free_ship = '{$full_free_ship}';
window.checkoutConfig.free_price = '{$free_price}'; window.checkoutConfig.free_price = '{$free_price}';
window.checkoutConfig.addressVisible = true;
window.checkoutConfig.shippingVisible = false;
window.checkoutConfig.paymentVisible = false;
window.checkoutConfig.logosrc = '{$logoUrl}';
window.checkoutConfig.isMobile = '{$isMobile}';
// Create aliases for customer.js model from customer module // Create aliases for customer.js model from customer module
window.isCustomerLoggedIn = window.checkoutConfig.isCustomerLoggedIn; window.isCustomerLoggedIn = window.checkoutConfig.isCustomerLoggedIn;
window.customerData = window.checkoutConfig.customerData; window.customerData = window.checkoutConfig.customerData;
...@@ -1025,10 +1731,8 @@ script; ...@@ -1025,10 +1731,8 @@ script;
<?= /* @noEscape */ $secureRenderer->renderTag('script', [], $scriptString, false) ?> <?= /* @noEscape */ $secureRenderer->renderTag('script', [], $scriptString, false) ?>
<?php $scriptString = <<<script <?php $scriptString = <<<script
require([ require([
'mage/url', 'mage/url'
'Magento_Ui/js/block-loader' ], function(url) {
], function(url, blockLoader) {
blockLoader("{$block->escapeJs($block->escapeUrl($block->getViewFileUrl('images/loader-1.gif')))}");
return url.setBaseUrl('{$block->escapeJs($block->escapeUrl($block->getBaseUrl()))}'); return url.setBaseUrl('{$block->escapeJs($block->escapeUrl($block->getBaseUrl()))}');
}) })
script; script;
...@@ -1038,6 +1742,7 @@ script; ...@@ -1038,6 +1742,7 @@ script;
<script> <script>
require(['jquery'], function ($) { require(['jquery'], function ($) {
var isMobile = window.matchMedia("(pointer:coarse)").matches; var isMobile = window.matchMedia("(pointer:coarse)").matches;
/*
if (!isMobile) { if (!isMobile) {
$(window).scroll(function () { $(window).scroll(function () {
var scrollTop = $(document).scrollTop(), var scrollTop = $(document).scrollTop(),
...@@ -1072,7 +1777,12 @@ script; ...@@ -1072,7 +1777,12 @@ script;
}); });
} }
$(document).on('focus', '#shipping input[type="email"],#shipping input[type="password"],#shipping input[type="text"]', function () { */
$(document).on('focus', '#customer-email-fieldset input[type="email"],' +
'#customer-email-fieldset input[type="password"],' +
'#shipping input[type="password"],' +
'#shipping input[type="text"],'+
'.checkout-billing-address input[type="text"]', function () {
if($(this).hasClass('select-input')) if($(this).hasClass('select-input'))
{ {
return false; return false;
...@@ -1082,7 +1792,11 @@ script; ...@@ -1082,7 +1792,11 @@ script;
} }
}); });
$(document).on('blur', '#shipping input[type="email"],#shipping input[type="password"],#shipping input[type="text"]', function () { $(document).on('blur', '#customer-email-fieldset input[type="email"],' +
'#customer-email-fieldset input[type="password"],' +
'#shipping input[type="password"],' +
'#shipping input[type="text"],' +
'.checkout-billing-address input[type="text"]', function () {
if($(this).hasClass('select-input')) if($(this).hasClass('select-input'))
{ {
return false; return false;
...@@ -1097,17 +1811,20 @@ script; ...@@ -1097,17 +1811,20 @@ script;
var thisVal = $(this).val(); var thisVal = $(this).val();
if(thisVal === '' || thisVal == null || thisVal.length === 0 || /^\s+$/.test(thisVal)) if(thisVal === '' || thisVal == null || thisVal.length === 0 || /^\s+$/.test(thisVal))
{ {
$(this).addClass('error-border-style') $(this).parent().addClass('error-border-style')
} }
else if($(this).hasClass('error-border-style')) else if($(this).parent().hasClass('error-border-style'))
{ {
$(this).removeClass('error-border-style') $(this).parent().removeClass('error-border-style')
} }
} }
}); });
$(document).on('focus', '#shipping .field.street ._required input[type="text"]', function () { $(document).on('focus',
'#shipping .field.street ._required input[type="text"],' +
'.checkout-billing-address .field.street ._required input[type="text"]',
function () {
if(!$(this).parent().parent().parent().prev('.label').hasClass('fouse-label')){ if(!$(this).parent().parent().parent().prev('.label').hasClass('fouse-label')){
$(this).parent().parent().parent().prev('.label').addClass('fouse-label') $(this).parent().parent().parent().prev('.label').addClass('fouse-label')
...@@ -1116,67 +1833,41 @@ script; ...@@ -1116,67 +1833,41 @@ script;
}); });
$(document).on('blur', '#shipping .field.street ._required input[type="text"]', function () { $(document).on('blur',
'#shipping .field.street ._required input[type="text"],' +
'.checkout-billing-address .field.street ._required input[type="text"]',
function () {
if($(this).parent().parent().parent().prev('.label').hasClass('fouse-label')){ if($(this).parent().parent().parent().prev('.label').hasClass('fouse-label')){
var thisVal = $(this).val(); var thisVal = $(this).val();
if(thisVal === '' || thisVal == null || thisVal.length === 0 || /^\s+$/.test(thisVal)) if(thisVal === '' || thisVal == null || thisVal.length === 0 || /^\s+$/.test(thisVal))
{ {
$(this).addClass('error-border-style'); $(this).parent().addClass('error-border-style');
$(this).parent().parent().parent().prev('.label').removeClass('fouse-label') $(this).parent().parent().parent().prev('.label').removeClass('fouse-label')
} }
else if($(this).hasClass('error-border-style')) else if($(this).parent().hasClass('error-border-style'))
{ {
$(this).removeClass('error-border-style') $(this).parent().removeClass('error-border-style')
} }
} }
}); });
//select-input $(document).on('change', '#shipping .check-select,.checkout-billing-address .check-select', function () {
if($(this).val() != '')
$(document).on('click', '#shipping .select-input', function () {
if($(this).next('.select').is(':visible'))
{ {
$(this).next('.select').hide(); if($(this).val() == '-')
$(this).next('.select').removeClass('select-style')
if($(this).val() == '')
{ {
if($(this).parent().prev('.label').hasClass('fouse-label')){ $(this).parent().addClass('error-border-style');
$(this).parent().prev('.label').removeClass('fouse-label'); }else {
$(this).hide();
$(this).removeClass('select-style');
if($(this).parent().hasClass('error-border-style')){
$(this).parent().removeClass('error-border-style');
} }
} }
} }
else else
{ {
$(this).next('.select').show(); $(this).parent().addClass('error-border-style');
$(this).next('.select').addClass('select-style');
if($(this).val() == '')
{
$(this).parent().prev('.label').addClass('fouse-label');
}
} }
});
//check-select
$(document).on('click', '#shipping .check-select', function () {
$(document).on('change', '#shipping .check-select', function () {
if($(this).val() != '')
{
if($(this).val() == '-')
{
$(this).prev('input').addClass('error-border-style');
}else {
$(this).hide();
$(this).removeClass('select-style');
if($(this).prev('input').hasClass('error-border-style')){
$(this).prev('input').removeClass('error-border-style');
}
}
}
else
{
$(this).prev('input').addClass('error-border-style');
}
});
}); });
......
...@@ -7,10 +7,12 @@ ...@@ -7,10 +7,12 @@
<li id="shipping" class="checkout-shipping-address" data-bind="fadeVisible: visible()"> <li id="shipping" class="checkout-shipping-address" data-bind="fadeVisible: visible()">
<!--<div class="step-title" translate="'Shipping Address'" data-role="title" />--> <!--<div class="step-title" translate="'Shipping Address'" data-role="title" />-->
<p class="step-title"> <p class="step-title">
<!--
<span class="number"> <span class="number">
<span translate="'1'" /> <span translate="'1'" />
</span> </span>
<span translate="'Delivery Details'" /> -->
<span translate="'Shipping address'" />
</p> </p>
<div id="checkout-step-shipping" <div id="checkout-step-shipping"
class="step-content" class="step-content"
......
...@@ -12,12 +12,12 @@ ...@@ -12,12 +12,12 @@
} }
</style> </style>
<div class="authentication-wrapper" data-block="authentication" data-bind="visible: isActive()"> <div class="authentication-wrapper" data-block="authentication" data-bind="visible: isActive()">
<span class="login-q-reg" data-bind="i18n: 'Already Registered?'"></span> <span class="login-q-reg" data-bind="i18n: 'Already have an account?'"></span>
<button <button
type="button" type="button"
class="action action-auth-toggle" class="action action-auth-toggle"
data-trigger="authentication"> data-trigger="authentication">
<span data-bind="i18n: 'Sign In'"></span> <span data-bind="i18n: 'Log In'"></span>
</button> </button>
<div class="block-authentication" <div class="block-authentication"
style="display: none" style="display: none"
......
...@@ -9,62 +9,73 @@ ...@@ -9,62 +9,73 @@
<!-- ko foreach: getRegion('before-login-form') --> <!-- ko foreach: getRegion('before-login-form') -->
<!-- ko template: getTemplate() --><!-- /ko --> <!-- ko template: getTemplate() --><!-- /ko -->
<!-- /ko --> <!-- /ko -->
<form class="form form-login" data-role="email-with-possible-login" <div class="email-box address-one" data-bind="fadeVisible:visible">
data-bind="submit:login" <div class="label-title">
method="post"> <span data-bind="i18n: 'Contact information'" class="contact-title"></span>
<fieldset id="customer-email-fieldset" class="fieldset" data-bind="blockLoader: isLoading"> <!-- ko foreach: getRegion('authentication') -->
<div class="field required"> <!-- ko template: getTemplate() --><!-- /ko -->
<label class="label" for="customer-email" data-bind="css:{'fouse-label': email}"> <!--/ko-->
<span data-bind="i18n: 'Email Address'"></span>
<!-- ko template: 'ui/form/element/helper/tooltip' --><!-- /ko -->
</label>
<div class="control _with-tooltip">
<input class="input-text"
type="email"
data-bind="
textInput: email,
hasFocus: emailFocused,
afterRender: emailHasChanged,
mageInit: {'mage/trim-input':{}},
css:{'virtual-email': quoteIsVirtual}"
name="username"
data-validate="{required:true, 'validate-email':true}"
id="customer-email" />
<span class="note" data-bind="fadeVisible: isPasswordVisible() == false"><!-- ko i18n: 'You can create an account after checkout.'--><!-- /ko --></span> </div>
</div> <form class="form form-login" data-role="email-with-possible-login"
</div> data-bind="submit:login"
method="post">
<fieldset id="customer-email-fieldset" class="fieldset" data-bind="blockLoader: isLoading">
<div class="field required">
<label class="label" for="customer-email" data-bind="css:{'fouse-label': email}">
<span data-bind="i18n: 'Email Address'"></span>
</label>
<!--Hidden fields --> <div class="control _with-tooltip">
<fieldset class="fieldset hidden-fields" data-bind="fadeVisible: isPasswordVisible">
<div class="field">
<label class="label" for="customer-password"><span data-bind="i18n: 'Password'"></span></label>
<div class="control">
<input class="input-text" <input class="input-text"
type="password" type="email"
name="password" data-bind="
id="customer-password" textInput: email,
data-validate="{required:true}" autocomplete="off"/> hasFocus: emailFocused,
<span class="note" data-bind="i18n: 'You already have an account with us. Sign in or continue as guest.'"></span> afterRender: emailHasChanged,
</div> mageInit: {'mage/trim-input':{}},
css:{'virtual-email': quoteIsVirtual}"
name="username"
data-validate="{required:true, 'validate-email':true}"
id="customer-emails" />
</div>
<span class="note email-note" data-bind="fadeVisible: isPasswordVisible() == false"><!-- ko i18n: 'You can create an account after checkout.'--><!-- /ko --></span>
</div> </div>
<!-- ko foreach: getRegion('additional-login-form-fields') -->
<!-- ko template: getTemplate() --><!-- /ko --> <!--Hidden fields -->
<!-- /ko --> <fieldset class="fieldset hidden-fields" data-bind="fadeVisible: isPasswordVisible">
<div class="actions-toolbar"> <div class="field">
<input name="context" type="hidden" value="checkout" /> <label class="label" for="customer-password"><span data-bind="i18n: 'Password'"></span></label>
<div class="primary"> <div class="control">
<button type="submit" class="action login primary" data-action="checkout-method-login"><span data-bind="i18n: 'Login'"></span></button> <input class="input-text"
type="password"
name="password"
id="customer-password"
data-validate="{required:true}" autocomplete="off"/>
<span class="note" data-bind="i18n: 'You already have an account with us. Sign in or continue as guest.'"></span>
</div>
</div> </div>
<div class="secondary"> <!-- ko foreach: getRegion('additional-login-form-fields') -->
<a class="action remind" data-bind="attr: { href: forgotPasswordUrl }"> <!-- ko template: getTemplate() --><!-- /ko -->
<span data-bind="i18n: 'Forgot Your Password?'"></span> <!-- /ko -->
</a> <div class="actions-toolbar">
<input name="context" type="hidden" value="checkout" />
<div class="primary">
<button type="submit" class="action login primary" data-action="checkout-method-login"><span data-bind="i18n: 'Login'"></span></button>
</div>
<div class="secondary">
<a class="action remind" data-bind="attr: { href: forgotPasswordUrl }">
<span data-bind="i18n: 'Forgot Your Password?'"></span>
</a>
</div>
</div> </div>
</div> </fieldset>
<!--Hidden fields -->
</fieldset> </fieldset>
<!--Hidden fields --> </form>
</fieldset> </div>
</form>
<!-- /ko --> <!-- /ko -->
\ No newline at end of file
...@@ -4,46 +4,50 @@ ...@@ -4,46 +4,50 @@
* See COPYING.txt for license details. * See COPYING.txt for license details.
*/ */
--> -->
<div class="right-fill"></div>
<div class="content content_wrapper">
<div class="trade_wrapper">
<div class="payment-left">
<!-- ko foreach: getRegion('progressBar') -->
<!-- ko template: getTemplate() --><!-- /ko -->
<!--/ko-->
<div class="payment-left"> <!-- ko foreach: getRegion('logo-nav') -->
<!-- ko foreach: getRegion('progressBar') -->
<!-- ko template: getTemplate() --><!-- /ko -->
<!--/ko-->
<!-- ko foreach: getRegion('authentication') -->
<!-- ko template: getTemplate() --><!-- /ko -->
<!--/ko-->
<!-- ko foreach: getRegion('estimation') -->
<!-- ko template: getTemplate() --><!-- /ko -->
<!--/ko-->
<!-- ko foreach: getRegion('messages') -->
<!-- ko template: getTemplate() --><!-- /ko -->
<!--/ko-->
<div class="opc-wrapper">
<ol class="opc" id="checkoutSteps">
<!-- ko foreach: getRegion('steps') -->
<!-- ko template: getTemplate() --><!-- /ko --> <!-- ko template: getTemplate() --><!-- /ko -->
<!--/ko--> <!--/ko-->
</ol>
</div> <!-- ko foreach: getRegion('paypal') -->
</div> <!-- ko template: getTemplate() --><!-- /ko -->
<div class="payment-right"> <!--/ko-->
<div class="slip-div">
<!-- ko foreach: getRegion('sidebar') --> <!-- ko foreach: getRegion('customer-email') -->
<!-- ko template: getTemplate() --><!-- /ko --> <!-- ko template: getTemplate() --><!-- /ko -->
<!--/ko--> <!--/ko-->
<!-- ko foreach: getRegion('placeOrder') --> <!-- ko foreach: getRegion('messages') -->
<!-- ko template: getTemplate() --><!-- /ko --> <!-- ko template: getTemplate() --><!-- /ko -->
<!--/ko--> <!--/ko-->
<div class="opc-wrapper">
<!-- ko foreach: getRegion('security') --> <ol class="opc" id="checkoutSteps">
<!-- ko template: getTemplate() --><!-- /ko --> <!-- ko foreach: getRegion('steps') -->
<!--/ko--> <!-- ko template: getTemplate() --><!-- /ko -->
<!--/ko-->
</ol>
</div>
<!-- ko foreach: getRegion('checkout-footer') -->
<!-- ko template: getTemplate() --><!-- /ko -->
<!--/ko-->
</div>
<div class="payment-right">
<!-- ko ifnot: isMobile() -->
<!-- ko foreach: getRegion('sidebar') -->
<!-- ko template: getTemplate() --><!-- /ko -->
<!--/ko-->
<!--/ko-->
</div>
</div> </div>
</div> </div>
...@@ -13,16 +13,18 @@ ...@@ -13,16 +13,18 @@
vertical-align: revert; vertical-align: revert;
} }
</style> </style>
<li id="shipping" class="checkout-shipping-address" data-bind="fadeVisible: visible()"> <li id="shipping" class="checkout-shipping-address address-one" data-bind="fadeVisible: addressVisible" style="order:1;">
<!--<div class="step-title" translate="'Shipping Address'" data-role="title" />--> <!--<div class="step-title" translate="'Shipping Address'" data-role="title" />-->
<p class="step-title"> <p class="step-title">
<!--
<span class="number"> <span class="number">
<span translate="'1'" /> <span translate="'1'" />
</span> </span>
<span translate="'Delivery Details'" /> -->
<span translate="'Shipping address'" />
</p> </p>
<div id="checkout-step-shipping" <div id="checkout-step-shipping"
class="step-content" class="step-content address-one"
data-role="content" style="margin-bottom: 1rem;"> data-role="content" style="margin-bottom: 1rem;">
<each if="!quoteIsVirtual" args="getRegion('customer-email')" render="" /> <each if="!quoteIsVirtual" args="getRegion('customer-email')" render="" />
...@@ -51,52 +53,82 @@ ...@@ -51,52 +53,82 @@
</div> </div>
<div id="shipping-text">
<div class="confirmed-address"> </li>
<div class="main-address shipping-address"> <li style="order:2;" data-bind="fadeVisible: !addressVisible" class="payment-content">
<div class="trade_info-preview form-primary-text trade_info-preact-dom sl_section--normal show-text">
<div id="email-text" data-bind="fadeVisible: shippingVisible" class="checkout-top-page">
<div class="trade_info-preview-item mian-text-line">
<div class="trade_info-preview-item_content">
<span class="left-title left-email trade_info-preview-item_label">
<!-- ko i18n: 'Contact'--><!-- /ko -->
</span>
<div class="main-text main-email trade_info-preview-item_text">
</div>
</div>
<button class="right-handle right-email trade_info-preview-item_button custom-link-color">
<span data-bind="i18n: 'Modify'"></span>
</button>
</div> </div>
</div> </div>
</div> <div id="shipping-text" data-bind="fadeVisible: shippingVisible" class="checkout-top-page">
<div class="billing-address-form"> <div class="trade_info-preview-item">
<each args="getRegion('after-shipping-method-form')" render="" /> <div class="trade_info-preview-item_content">
</div> <span class="left-title left-address trade_info-preview-item_label">
<div id="next-shipping"> <!-- ko i18n: 'Ship to'--><!-- /ko -->
<span><!-- ko i18n: 'Save & Continue'--><!-- /ko --></span> </span>
</div> <div class="main-text main-address shipping-address trade_info-preview-item_text">
<div id="edit-shipping" style="display:none;"> </div>
<a href="javascript:;" id="editLink" style="color:#000;"> </div>
<span><!-- ko i18n: 'Edit'--><!-- /ko --></span> <button class="right-handle right-address trade_info-preview-item_button custom-link-color">
<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24"> <span data-bind="i18n: 'Modify'"></span>
<path d="M19.769 9.923l-12.642 12.639-7.127 1.438 1.438-7.128 12.641-12.64 5.69 5.691zm1.414-1.414l2.817-2.82-5.691-5.689-2.816 2.817 5.69 5.692z"></path> </button>
</svg> </div>
</a>
</div>
</li> </div>
<div id="method-text" data-bind="fadeVisible: paymentVisible" class="checkout-top-page payment-three">
<div class="trade_info-preview-item">
<div class="trade_info-preview-item_content">
<span class="left-title left-method trade_info-preview-item_label">
<!-- ko i18n: 'Method'--><!-- /ko -->
</span>
<div class="main-text main-method trade_info-preview-item_text">
</div>
</div>
<button class="right-handle right-method trade_info-preview-item_button custom-link-color">
<span data-bind="i18n: 'Modify'"></span>
</button>
</div>
</div>
</div>
</li>
<!--Shipping method template--> <!--Shipping method template-->
<li id="opc-shipping_method" <li id="opc-shipping_method"
class="checkout-shipping-method" class="checkout-shipping-method shipping-two"
data-bind="fadeVisible: visible(), blockLoader: isLoading" data-bind="fadeVisible: shippingVisible, blockLoader: isLoading"
role="presentation"> role="presentation" style="order:3;">
<div class="checkout-shipping-method"> <div class="checkout-shipping-method">
<!--<div class="step-title" <!--<div class="step-title"
translate="'Shipping Methods'" translate="'Shipping Methods'"
data-role="title" />--> data-role="title" />-->
<p class="step-title no-border"> <p class="step-title no-border">
<span class="number"> <!--
<span translate="'2'" /> <span class="number">
</span> <span translate="'2'" />
</span>
-->
<span translate="'Shipping Methods'" /> <span translate="'Shipping Methods'" />
</p> </p>
<each args="getRegion('before-shipping-method-form')" render="" /> <each args="getRegion('before-shipping-method-form')" render="" />
<div id="checkout-step-shipping_method" <div id="checkout-step-shipping_method"
class="step-content" class="step-content shipping-two"
data-role="content" data-role="content"
role="tabpanel" role="tabpanel"
aria-hidden="false"> aria-hidden="shippingVisible()">
<form id="co-shipping-method-form" <form id="co-shipping-method-form"
class="form methods-shipping" class="form methods-shipping"
if="rates().length" if="rates().length"
...@@ -127,3 +159,45 @@ ...@@ -127,3 +159,45 @@
</div> </div>
</div> </div>
</li> </li>
<li class="billing-address-li payment-three" data-bind="fadeVisible: paymentVisible" style="order:5;">
<div class="billing-address-form">
<each args="getRegion('after-shipping-method-form')" render="" />
</div>
</li>
<li class="handle-line" style="order:6;">
<div id="next-shipping">
<button class="handle-btn custom-link-color">
<span>
<span class="svg-left" >
<svg width="16" height="16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M8.003 8.483L4.52 5.436l-.988 1.128 4.465 3.907 4.512-3.904-.982-1.134-3.524 3.05z" fill="currentColor"></path>
</svg>
</span>
<span data-bind="click: backToCart,fadeVisible: addressVisible" class="address-one">
<!-- ko i18n: 'Return to cart'--><!-- /ko -->
</span>
<span data-bind="fadeVisible: shippingVisible" class="shipping-two back-to-information">
<!-- ko i18n: 'Return to Information'--><!-- /ko -->
</span>
<span data-bind="fadeVisible: paymentVisible" class="payment-three back-to-shipping">
<!-- ko i18n: 'Return to Shipping'--><!-- /ko -->
</span>
</span>
</button>
<span class="save-continue continue-shipping address-one" data-bind="fadeVisible: addressVisible"><!-- ko i18n: 'Continue to Shipping'--><!-- /ko --></span>
<span class="save-continue continue-payment shipping-two" data-bind="fadeVisible: shippingVisible"><!-- ko i18n: 'Continue to Payment'--><!-- /ko --></span>
<span class="save-continue complete-order payment-three " data-bind="fadeVisible: paymentVisible">
<span class="coBtn"><!-- ko i18n: 'Complete Order'--><!-- /ko --></span>
</span>
<span class="save-continue waitBtn" style="display: none;">
<span class="wait-loop"><!-- ko i18n: 'Please wait'--><!-- /ko --><div class="jkl"></div></span>
</span>
</div>
</li>
...@@ -4,14 +4,24 @@ ...@@ -4,14 +4,24 @@
* See COPYING.txt for license details. * See COPYING.txt for license details.
*/ */
--> -->
<div class="block items-in-cart" data-bind="mageInit: {'collapsible':{'closeOnOuter':false,'openedState': 'false', 'active': false}}"> <div class="block items-in-cart bottom-border" data-bind="mageInit: {'collapsible':{'closeOnOuter':false,'openedState': 'false', 'active': !isMobile()}}">
<!-- ko if: isMobile() -->
<div class="title" data-role="title"> <div class="title" data-role="title">
<strong role="heading" aria-level="1"> <strong role="heading" aria-level="1" class="mobile-control">
<span class="estimated-label" data-bind="i18n: 'Order Summary'"></span> <span class="cart-icon" style="display: inline-block;color:#276EAF;margin-right: 12px;">
<svg width="21" height="21" viewBox="0 0 21 21" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M14.0001 13C14.5524 13 15.0001 12.5523 15.0001 12C15.0001 11.4477 14.5524 11 14.0001 11H8.00015C7.44786 11 7.00015 11.4477 7.00015 12C7.00015 12.5523 7.44786 13 8.00015 13H14.0001Z" fill="currentColor"></path>
<path fill-rule="evenodd" clip-rule="evenodd" d="M1.50504 11.0996L1.50644 11.1128L2.00512 16.0995C2.05624 16.6107 2.4864 17 3.00015 17H19.0002C19.5139 17 19.9441 16.6107 19.9952 16.0995L20.9952 6.0995C21.0233 5.81838 20.9312 5.53848 20.7416 5.329C20.552 5.11951 20.2827 5 20.0002 5H2.90505L2.49511 0.900571C2.44016 0.351027 1.95011 -0.0499167 1.40057 0.00503759C0.851027 0.0599919 0.450083 0.550035 0.505038 1.09958L1.50504 11.0996ZM3.10514 7L3.90514 15H18.0952L18.8952 7H3.10514Z" fill="currentColor"></path>
<path d="M8.00015 19.5C8.00015 20.3284 7.32858 21 6.50015 21C5.67172 21 5.00015 20.3284 5.00015 19.5C5.00015 18.6716 5.67172 18 6.50015 18C7.32858 18 8.00015 18.6716 8.00015 19.5Z" fill="currentColor"></path>
<path d="M15.5001 21C16.3286 21 17.0001 20.3284 17.0001 19.5C17.0001 18.6716 16.3286 18 15.5001 18C14.6717 18 14.0001 18.6716 14.0001 19.5C14.0001 20.3284 14.6717 21 15.5001 21Z" fill="currentColor"></path>
</svg>
</span>
<span class="estimated-label" data-bind="i18n: 'Order summary'"></span>
<span class="estimated-price" data-bind="text: getGrandTotal()"></span> <span class="estimated-price" data-bind="text: getGrandTotal()"></span>
</strong> </strong>
</div> </div>
<div class="content minicart-items" data-role="content"> <!-- /ko -->
<div class="content minicart-items" data-role="content" aria-hidden="false">
<div class="minicart-items-wrapper"> <div class="minicart-items-wrapper">
<ol class="minicart-items"> <ol class="minicart-items">
<each args="items()"> <each args="items()">
......
...@@ -6,41 +6,36 @@ ...@@ -6,41 +6,36 @@
--> -->
<!-- ko foreach: getRegion('before_details') --> <!-- ko foreach: getRegion('before_details') -->
<!-- ko template: getTemplate() --><!-- /ko --> <!-- ko template: getTemplate() --><!-- /ko -->
<!-- /ko --> <!-- /ko -->
<div class="product-item-details"> <div class="product-item-details">
<div class="product-item-inner"> <div class="product-item-inner">
<div class="product-item-name-block"> <div class="product-item-name-block">
<strong class="product-item-name" data-bind="html: getNameUnsanitizedHtml($parent)"></strong> <strong class="product-item-name" data-bind="html: getNameUnsanitizedHtml($parent)"></strong>
<div class="details-qty">
<span class="label"><!-- ko i18n: 'Qty' --><!-- /ko --></span>
<span class="value" data-bind="text: $parent.qty"></span>
</div>
</div> </div>
<!-- ko foreach: getRegion('after_details') --> <!-- ko foreach: getRegion('after_details') -->
<!-- ko template: getTemplate() --><!-- /ko --> <!-- ko template: getTemplate() --><!-- /ko -->
<!-- /ko --> <!-- /ko -->
</div> </div>
<!-- ko if: (JSON.parse($parent.options).length > 0)--> <!-- ko if: (JSON.parse($parent.options).length > 0)-->
<div class="product options" data-bind="mageInit: {'collapsible':{'openedState': 'active'}}"> <div class="product options active">
<span data-role="title" class="toggle"><!-- ko i18n: 'View Details' --><!-- /ko --></span>
<div data-role="content" class="content"> <div data-role="content" class="content">
<strong class="subtitle"><!-- ko i18n: 'Options Details' --><!-- /ko --></strong> <strong class="subtitle"><!-- ko i18n: 'Options Details' --><!-- /ko --></strong>
<dl class="item-options"> <dl class="item-options">
<!--ko foreach: JSON.parse($parent.options)--> <!--ko foreach: JSON.parse($parent.options)-->
<dt class="label" data-bind="text: label"></dt> <dt class="label" data-bind="text: label"></dt>
<!-- ko if: ($data.full_view)--> <!-- ko if: ($data.full_view)-->
<!-- ko with: {full_viewUnsanitizedHtml: $data.full_view}--> <!-- ko with: {full_viewUnsanitizedHtml: $data.full_view}-->
<dd class="values" data-bind="html: full_viewUnsanitizedHtml"></dd> <dd class="values" data-bind="html: full_viewUnsanitizedHtml"></dd>
<!-- /ko --> <!-- /ko -->
<!-- /ko --> <!-- /ko -->
<!-- ko ifnot: ($data.full_view)--> <!-- ko ifnot: ($data.full_view)-->
<!-- ko with: {valueUnsanitizedHtml: $data.value}--> <!-- ko with: {valueUnsanitizedHtml: $data.value}-->
<dd class="values" data-bind="html: valueUnsanitizedHtml"></dd> <dd class="values" data-bind="html: valueUnsanitizedHtml"></dd>
<!-- /ko --> <!-- /ko -->
<!-- /ko --> <!-- /ko -->
<!-- /ko --> <!-- /ko -->
</dl> </dl>
</div> </div>
...@@ -48,5 +43,5 @@ ...@@ -48,5 +43,5 @@
<!-- /ko --> <!-- /ko -->
</div> </div>
<!-- ko foreach: getRegion('item_message') --> <!-- ko foreach: getRegion('item_message') -->
<!-- ko template: getTemplate() --><!-- /ko --> <!-- ko template: getTemplate() --><!-- /ko -->
<!-- /ko --> <!-- /ko -->
...@@ -7,7 +7,9 @@ ...@@ -7,7 +7,9 @@
<span class="product-image-container" <span class="product-image-container"
data-bind="attr: {'style': 'height: ' + getHeight($parents[1])/2 + 'px; width: ' + getWidth($parents[1])/2 + 'px;' }"> data-bind="attr: {'style': 'height: ' + getHeight($parents[1])/2 + 'px; width: ' + getWidth($parents[1])/2 + 'px;' }">
<span class="product-image-wrapper"> <span class="product-image-wrapper">
<img <img data-bind="attr: {'src': getSrc($parents[1]), 'width': getWidth($parents[1]), 'height': getHeight($parents[1]), 'alt': getAlt($parents[1]), 'title': getAlt($parents[1]) }"/>
data-bind="attr: {'src': getSrc($parents[1]), 'width': getWidth($parents[1]), 'height': getHeight($parents[1]), 'alt': getAlt($parents[1]), 'title': getAlt($parents[1]) }"/>
</span> </span>
<div class="details-qty">
<span class="value" data-bind="text: $parents[1].qty"></span>
</div>
</span> </span>
...@@ -5,12 +5,12 @@ ...@@ -5,12 +5,12 @@
*/ */
--> -->
<tr class="totals"> <tr class="totals subtotal">
<th class="mark" scope="row" data-bind="text: title"></th> <th class="mark" scope="row" data-bind="text: title"></th>
<td class="amount"> <td class="amount">
<span class="price" data-bind ="text: getValue(), attr:{'data-label': title}"></span> <span class="price" data-bind ="text: getValue(), attr:{'data-label': title}"></span>
<!-- ko foreach: elems() --> <!-- ko foreach: elems() -->
<!-- ko template: getTemplate() --><!-- /ko --> <!-- ko template: getTemplate() --><!-- /ko -->
<!-- /ko --> <!-- /ko -->
</td> </td>
</tr> </tr>
...@@ -213,6 +213,8 @@ define([ ...@@ -213,6 +213,8 @@ define([
// option's json config // option's json config
jsonConfig: {}, jsonConfig: {},
sizeChartData : {},
// swatch's json config // swatch's json config
jsonSwatchConfig: {}, jsonSwatchConfig: {},
...@@ -395,6 +397,152 @@ define([ ...@@ -395,6 +397,152 @@ define([
}; };
}, },
_getSizeChartData: function (item, value) {
var chartData = this.options.sizeChartData;
if (chartData.length == 0) {
return '';
}
chartData = JSON.parse(chartData);
var len = chartData.length
var currentItem = [];
for (let i = 0; i < len; i++) {
var current = chartData[i];
if (value.toLowerCase() == current[0].toLowerCase()) {
currentItem = chartData[i];
break;
}
}
if (currentItem.length == 0) {
return '';
}
var option = chartData[0];
let label = '';
var labelLen = currentItem.length
for (let i = 0; i < labelLen; i++) {
if (i == 0) {
label += currentItem[i]+" : ";
continue;
}
label += option[i] + ' ' + currentItem[i] +"(inc) ";
if (i < labelLen - 1) {
label +=", ";
}
}
return label;
},
_RenderSwatchWithCustomerOptions: function (config, controlId) {
var optionConfig = this.options.jsonSwatchConfig[config.id],
optionClass = this.options.classes.optionClass,
sizeConfig = this.options.jsonSwatchImageSizeConfig,
moreLimit = parseInt(this.options.numberToShow, 10),
moreClass = this.options.classes.moreButton,
moreText = this.options.moreButtonText,
countAttributes = 0,
$widget = this,
html = '';
if (!this.options.jsonSwatchConfig.hasOwnProperty(config.id)) {
return '';
}
$.each(config.options, function (index) {
var id,
type,
value,
thumb,
label,
width,
height,
attr,
swatchImageWidth,
swatchImageHeight;
if (!optionConfig.hasOwnProperty(this.id)) {
return '';
}
// Add more button
if (moreLimit === countAttributes++) {
html += '<a href="#" class="' + moreClass + '"><span>' + moreText + '</span></a>';
}
id = this.id;
type = parseInt(optionConfig[id].type, 10);
value = optionConfig[id].hasOwnProperty('value') ?
$('<i></i>').text(optionConfig[id].value).html() : '';
thumb = optionConfig[id].hasOwnProperty('thumb') ? optionConfig[id].thumb : '';
width = _.has(sizeConfig, 'swatchThumb') ? sizeConfig.swatchThumb.width : 110;
height = _.has(sizeConfig, 'swatchThumb') ? sizeConfig.swatchThumb.height : 90;
label = this.label ? $('<i></i>').text(this.label).html() : '';
label = $widget._getSizeChartData($(this), optionConfig[id].value);
attr =
' id="' + controlId + '-item-' + id + '"' +
' index="' + index + '"';
if(index == 0)
{
attr += ' aria-checked="true"';
}
else {
attr += ' aria-checked="false"';
}
attr += ' aria-describedby="' + controlId + '"' +
' tabindex="0"' +
' data-option-type="' + type + '"' +
' data-option-id="' + id + '"' +
' data-option-label="' + label + '"' +
' aria-label="' + label + '"' +
' role="option"' +
' data-thumb-width="' + width + '"' +
' data-thumb-height="' + height + '"';
attr += thumb !== '' ? ' data-option-tooltip-thumb="' + thumb + '"' : '';
attr += value !== '' ? ' data-option-tooltip-value="' + value + '"' : '';
swatchImageWidth = _.has(sizeConfig, 'swatchImage') ? sizeConfig.swatchImage.width : 30;
swatchImageHeight = _.has(sizeConfig, 'swatchImage') ? sizeConfig.swatchImage.height : 20;
if (!this.hasOwnProperty('products') || this.products.length <= 0) {
attr += ' data-option-empty="true"';
}
var selectedStr = '';
if(index == 0)
{
selectedStr = ' selected';
}
if (type === 0) {
// Text
html += '<div class="' + optionClass + ' text' + selectedStr + '" ' + attr + '>' + (value ? value : label) +
'</div>';
} else if (type === 1) {
// Color
html += '<div class="' + optionClass + ' color' + selectedStr + '" ' + attr +
' style="background: ' + value +
' no-repeat center; background-size: cover;">' + '' +
'</div>';
} else if (type === 2) {
// Image
html += '<div class="' + optionClass + ' image' + selectedStr + '" ' + attr +
' style="background: url(' + value + ') no-repeat center; background-size: cover;width:' +
swatchImageWidth + 'px; height:' + swatchImageHeight + 'px">' + '' +
'</div>';
} else if (type === 3) {
// Clear
html += '<div class="' + optionClass + selectedStr + '" ' + attr + '></div>';
} else {
// Default
html += '<div class="' + optionClass + selectedStr + '" ' + attr + '>' + label + '</div>';
}
});
return html;
},
/** /**
* Render controls * Render controls
* *
...@@ -406,12 +554,13 @@ define([ ...@@ -406,12 +554,13 @@ define([
classes = this.options.classes, classes = this.options.classes,
chooseText = this.options.jsonConfig.chooseText, chooseText = this.options.jsonConfig.chooseText,
showTooltip = this.options.showTooltip; showTooltip = this.options.showTooltip;
var optionConfig = this.options.jsonSwatchConfig;
var that = this;
$widget.optionsMap = {}; $widget.optionsMap = {};
$.each(this.options.jsonConfig.attributes, function () { $.each(this.options.jsonConfig.attributes, function () {
var item = this, var item = this,
controlLabelId = 'option-label-' + item.code + '-' + item.id, controlLabelId = 'option-label-' + item.code + '-' + item.id,
options = $widget._RenderSwatchOptions(item, controlLabelId),
select = $widget._RenderSwatchSelect(item, chooseText), select = $widget._RenderSwatchSelect(item, chooseText),
areaCheckedId =$widget._RenderSwatchFirstOptionsId(item, controlLabelId), areaCheckedId =$widget._RenderSwatchFirstOptionsId(item, controlLabelId),
CheckedId =$widget._RenderSwatchCheckedOptionsId(item), CheckedId =$widget._RenderSwatchCheckedOptionsId(item),
...@@ -419,6 +568,12 @@ define([ ...@@ -419,6 +568,12 @@ define([
listLabel = '', listLabel = '',
label = ''; label = '';
if (item.code == "size") {
var options = $widget._RenderSwatchWithCustomerOptions(item, controlLabelId);
} else {
var options = $widget._RenderSwatchOptions(item, controlLabelId);
}
// Show only swatch controls // Show only swatch controls
if ($widget.options.onlySwatches && !$widget.options.jsonSwatchConfig.hasOwnProperty(item.id)) { if ($widget.options.onlySwatches && !$widget.options.jsonSwatchConfig.hasOwnProperty(item.id)) {
return; return;
...@@ -450,9 +605,13 @@ define([ ...@@ -450,9 +605,13 @@ define([
} }
if (item.id == 137) { if (item.id == 137) {
// Create new control // Create new control
var sizeContent = '<div class="swatch-attribute-selected-option-size-content" style="display:block;">'+ var sizeContentText = that._getSizeChartData(item, optionConfig[137][item.options[0].id].value);
'<div>'+$.mage.__("Product Size Describe")+ '</div>'+ var sizeContent = '';
'<span class="'+classes.attributeSelectedOptionLabelClass + '">'+item.options[0].label+'</span></div>'; if (sizeContentText.length > 0) {
sizeContent += '<div class="swatch-attribute-selected-option-size-content" style="display:block;">';
sizeContent += '<span class="'+classes.attributeSelectedOptionLabelClass + '">'+that._getSizeChartData(item, optionConfig[137][item.options[0].id].value)+'</span>';
sizeContent += "</div>";
}
container.append( container.append(
'<div class="' + classes.attributeClass + ' ' + item.code + '" ' + '<div class="' + classes.attributeClass + ' ' + item.code + '" ' +
......
...@@ -106,7 +106,11 @@ ...@@ -106,7 +106,11 @@
<referenceBlock name="copyright" remove="true"/> <referenceBlock name="copyright" remove="true"/>
</referenceContainer> </referenceContainer>
<referenceContainer name="before.body.end"> <referenceContainer name="before.body.end">
<block class="Magento\Theme\Block\Html\Footer" name="footer" template="Magento_Theme::html/footer.phtml" cacheable="true" /> <block class="Magento\Theme\Block\Html\Footer" name="footer" template="Magento_Theme::html/footer.phtml">
<arguments>
<argument name="cache_lifetime" xsi:type="number">3600</argument>
</arguments>
</block>
</referenceContainer> </referenceContainer>
<referenceContainer name="content"> <referenceContainer name="content">
<block class="Magento\Framework\View\Element\FormKey" name="formkey"/> <block class="Magento\Framework\View\Element\FormKey" name="formkey"/>
......
...@@ -75,7 +75,7 @@ ...@@ -75,7 +75,7 @@
position: fixed; position: fixed;
font-size: larger; font-size: larger;
bottom: 0; bottom: 0;
z-index: 1; z-index: 6;
margin: 0 auto; margin: 0 auto;
left: 0; left: 0;
right: 0; right: 0;
...@@ -342,7 +342,7 @@ footer .footer_link{ ...@@ -342,7 +342,7 @@ footer .footer_link{
position: fixed; position: fixed;
font-size: larger; font-size: larger;
bottom: 0; bottom: 0;
z-index: 1; z-index: 6;
width: 100%; width: 100%;
margin: 0 auto; margin: 0 auto;
left: 0; left: 0;
...@@ -588,6 +588,9 @@ ul { ...@@ -588,6 +588,9 @@ ul {
#topBtn { #topBtn {
width: 8% !important; width: 8% !important;
} }
.checkout-cart-index .page.messages{
margin-top: 65px;
}
} }
.categories_tab { .categories_tab {
...@@ -926,7 +929,7 @@ p.shopbycate-title { ...@@ -926,7 +929,7 @@ p.shopbycate-title {
} }
div#cart-totals{ div#cart-totals{
margin-bottom: 20px; margin: 20px 0px;
} }
.discount-area{ .discount-area{
color:#fa320f; color:#fa320f;
...@@ -2704,7 +2707,7 @@ button.action.submit.primary { ...@@ -2704,7 +2707,7 @@ button.action.submit.primary {
} }
.swatch-attribute.size .swatch-attribute-selected-option{ .swatch-attribute.size .swatch-attribute-selected-option{
font-size: .8rem; font-size: .85rem;
} }
.swatch-attribute-selected-option-size-content{ .swatch-attribute-selected-option-size-content{
......
...@@ -697,11 +697,7 @@ ...@@ -697,11 +697,7 @@
showLabel: function (element, message) { showLabel: function (element, message) {
if($('body').hasClass('checkout-index-index')) if($('body').hasClass('checkout-index-index'))
{ {
if($(element).is('select')){ $(element).parent().addClass('error-border-style');
$(element).prev('input').addClass('error-border-style');
}else if($(element).is('input')){
$(element).addClass('error-border-style');
}
this.toShow = this.toShow.add(''); this.toShow = this.toShow.add('');
} }
else { else {
......
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