This commit is contained in:
Roman Pyrih
2024-11-25 15:54:43 +01:00
parent 2f3895e223
commit 1a56dbea66
15 changed files with 11712 additions and 189 deletions

View File

@@ -22,7 +22,110 @@
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
*}
<div class="product-line-grid">
<tr>
<td>
<div class="product-card-img">
{if $product.default_image}
<img src="{$product.default_image.bySize.cart_default.url}" alt="{$product.name|escape:'quotes'}" loading="lazy">
{else}
<img src="{$urls.no_picture_image.bySize.cart_default.url}" loading="lazy" />
{/if}
</div>
</td>
<td>
<div class="product-card-desc">
<a class="label" href="{$product.url}" data-id_customization="{$product.id_customization|intval}">{$product.name}</a>
</div>
<div class="product-card-infos">
{foreach from=$product.attributes key="attribute" item="value"}
<div class="product-card-info {$attribute|lower}">
<span class="label">{$attribute}:</span>
<span class="value">{$value}</span>
</div>
{/foreach}
</div>
</td>
<td>
<div class="product-card-price {if $product.has_discount}has-discount{/if}">
<div class="current-price">
<span class="price">{$product.price}</span>
{if $product.unit_price_full}
<div class="unit-price-cart">{$product.unit_price_full}</div>
{/if}
</div>
{if $product.has_discount}
<div class="product-discount">
<span class="regular-price">{$product.regular_price}</span>
</div>
{/if}
{hook h='displayProductPriceBlock' product=$product type="unit_price"}
</div>
</td>
<td>
<div class="product-card-qty">
{if !empty($product.is_gift)}
<span class="gift-quantity">{$product.quantity}</span>
{else}
<input
class="js-cart-line-product-quantity"
data-down-url="{$product.down_quantity_url}"
data-up-url="{$product.up_quantity_url}"
data-update-url="{$product.update_quantity_url}"
data-product-id="{$product.id_product}"
type="number"
inputmode="numeric"
pattern="[0-9]*"
value="{$product.quantity}"
name="product-quantity-spin"
aria-label="{l s='%productName% product quantity field' sprintf=['%productName%' => $product.name] d='Shop.Theme.Checkout'}"
/>
{/if}
</div>
</td>
<td>
<div class="product-card-sum-price">
<strong>
{if !empty($product.is_gift)}
<span class="gift">{l s='Gift' d='Shop.Theme.Checkout'}</span>
{else}
{$product.total}
{/if}
</strong>
</div>
</td>
<td>
<div class="product-card-action">
<a
class = "remove-from-cart"
rel = "nofollow"
href = "{$product.remove_from_cart_url}"
data-link-action = "delete-from-cart"
data-id-product = "{$product.id_product|escape:'javascript'}"
data-id-product-attribute = "{$product.id_product_attribute|escape:'javascript'}"
data-id-customization = "{$product.id_customization|escape:'javascript'}"
>
{if empty($product.is_gift)}
<i class="material-icons float-xs-left">delete</i>
{/if}
</a>
{block name='hook_cart_extra_product_actions'}
{hook h='displayCartExtraProductActions' product=$product}
{/block}
</div>
</td>
</tr>
{* <div class="product-line-grid">
<!-- product line left content: image-->
<div class="product-line-grid-left col-md-3 col-xs-4">
<span class="product-image media-middle">
@@ -179,4 +282,4 @@
</div>
<div class="clearfix"></div>
</div>
</div> *}

View File

@@ -23,36 +23,34 @@
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
*}
{block name='cart_detailed_totals'}
<div class="cart-detailed-totals js-cart-detailed-totals">
<div class="cart-detailed-totals js-cart-detailed-totals">
<div class="card-block cart-detailed-subtotals js-cart-detailed-subtotals">
{foreach from=$cart.subtotals item="subtotal"}
{if $subtotal && $subtotal.value|count_characters > 0 && $subtotal.type !== 'tax'}
<div class="cart-summary-line" id="cart-subtotal-{$subtotal.type}">
<span class="label{if 'products' === $subtotal.type} js-subtotal{/if}">
{if 'products' == $subtotal.type}
{$cart.summary_string}
{else}
{$subtotal.label}
<div class="card-block cart-detailed-subtotals js-cart-detailed-subtotals 1">
{foreach from=$cart.subtotals item="subtotal"}
{if $subtotal && $subtotal.value|count_characters > 0 && $subtotal.type !== 'tax'}
<div class="cart-summary-line" id="cart-subtotal-{$subtotal.type}">
<span class="label{if 'products' === $subtotal.type} js-subtotal{/if}">
{* {if 'products' == $subtotal.type}
{$cart.summary_string}
{else} *}
{$subtotal.label}
{* {/if} *}
</span>
<span class="value">
{if 'discount' == $subtotal.type}-&nbsp;{/if}{$subtotal.value}
</span>
{if $subtotal.type === 'shipping'}
<div><small class="value">{hook h='displayCheckoutSubtotalDetails' subtotal=$subtotal}</small></div>
{/if}
</span>
<span class="value">
{if 'discount' == $subtotal.type}-&nbsp;{/if}{$subtotal.value}
</span>
{if $subtotal.type === 'shipping'}
<div><small class="value">{hook h='displayCheckoutSubtotalDetails' subtotal=$subtotal}</small></div>
{/if}
</div>
{/if}
{/foreach}
</div>
{/if}
{/foreach}
</div>
{block name='cart_summary_totals'}
{include file='checkout/_partials/cart-summary-totals.tpl' cart=$cart}
{/block}
</div>
{block name='cart_summary_totals'}
{include file='checkout/_partials/cart-summary-totals.tpl' cart=$cart}
{/block}
{block name='cart_voucher'}
{include file='checkout/_partials/cart-voucher.tpl'}
{/block}
</div>
{/block}

View File

@@ -24,19 +24,53 @@
*}
{block name='cart_detailed_product'}
<div class="cart-overview js-cart" data-refresh-url="{url entity='cart' params=['ajax' => true, 'action' => 'refresh']}">
{if $cart.products}
<ul class="cart-items">
{foreach from=$cart.products item=product}
<li class="cart-item">
{block name='cart_detailed_product_line'}
{include file='checkout/_partials/cart-detailed-product-line.tpl' product=$product}
{/block}
</li>
{if is_array($product.customizations) && $product.customizations|count >1}<hr>{/if}
{/foreach}
</ul>
<div class="cart-items-header">
<h3 class="h3">Twoje produkty ({count($cart.products)})</h3>
</div>
<table >
<thead>
<tr>
<th colspan="2">Nazwa produktu</th>
<th>Cena jednostkowa</th>
<th>Ilość</th>
<th>Cena łączna</th>
<th></th>
</tr>
</thead>
<tbody>
{if $cart.products}
{foreach from=$cart.products item=product}
{block name='cart_detailed_product_line'}
{include file='checkout/_partials/cart-detailed-product-line.tpl' product=$product}
{/block}
{if is_array($product.customizations) && $product.customizations|count >1}<hr>{/if}
{/foreach}
{else}
<tr>
<td colspan="6">
<span class="no-items">{l s='There are no more items in your cart' d='Shop.Theme.Checkout'}</span>
</td>
</tr>
{/if}
</tbody>
</table>
{* {if $cart.products}
<ul class="cart-items">
{foreach from=$cart.products item=product}
<li class="cart-item">
{block name='cart_detailed_product_line'}
{include file='checkout/_partials/cart-detailed-product-line.tpl' product=$product}
{/block}
</li>
{if is_array($product.customizations) && $product.customizations|count >1}<hr>{/if}
{/foreach}
</ul>
{else}
<span class="no-items">{l s='There are no more items in your cart' d='Shop.Theme.Checkout'}</span>
{/if}
{/if} *}
</div>
{/block}

View File

@@ -24,17 +24,16 @@
*}
<div class="cart-summary-products js-cart-summary-products">
<p>{$cart.summary_string}</p>
<p>
<h3 class="h4">Twoje produkty ({$cart.products_count})</h3>
{* <p>
<a href="#" data-toggle="collapse" data-target="#cart-summary-product-list" class="js-show-details">
{l s='show details' d='Shop.Theme.Actions'}
<i class="material-icons">expand_more</i>
</a>
</p>
</p> *}
{block name='cart_summary_product_list'}
<div class="collapse" id="cart-summary-product-list">
<div class="collapse1" id="cart-summary-product-list">
<ul class="media-list">
{foreach from=$cart.products item=product}
<li class="media">{include file='checkout/_partials/cart-summary-product-line.tpl' product=$product}</li>

View File

@@ -23,24 +23,26 @@
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
*}
<section id="js-checkout-summary" class="card js-cart" data-refresh-url="{$urls.pages.cart}?ajax=1&action=refresh">
<div class="card-block">
{block name='hook_checkout_summary_top'}
{include file='checkout/_partials/cart-summary-top.tpl' cart=$cart}
{/block}
<div class="js-checkout-summary-box">
<div class="card-block">
{block name='hook_checkout_summary_top'}
{include file='checkout/_partials/cart-summary-top.tpl' cart=$cart}
{/block}
{block name='cart_summary_products'}
{include file='checkout/_partials/cart-summary-products.tpl' cart=$cart}
{/block}
{block name='cart_summary_products'}
{include file='checkout/_partials/cart-summary-products.tpl' cart=$cart}
{/block}
{block name='cart_summary_subtotals'}
{include file='checkout/_partials/cart-summary-subtotals.tpl' cart=$cart}
{block name='cart_summary_subtotals'}
{include file='checkout/_partials/cart-summary-subtotals.tpl' cart=$cart}
{/block}
</div>
{block name='cart_summary_totals'}
{include file='checkout/_partials/cart-summary-totals.tpl' cart=$cart}
{/block}
</div>
{block name='cart_summary_totals'}
{include file='checkout/_partials/cart-summary-totals.tpl' cart=$cart}
{/block}
{block name='cart_summary_voucher'}
{include file='checkout/_partials/cart-voucher.tpl'}
{/block}

View File

@@ -44,20 +44,22 @@
{/block}
{/if}
<p class="promo-code-button display-promo{if $cart.discounts|count > 0} with-discounts{/if}">
{* <p class="promo-code-button display-promo{if $cart.discounts|count > 0} with-discounts{/if}">
<a class="collapse-button" href="#promo-code">
{l s='Have a promo code?' d='Shop.Theme.Checkout'}
</a>
</p>
</p> *}
<div id="promo-code" class="collapse{if $cart.discounts|count > 0} in{/if}">
{* <div id="promo-code" class="collapse{if $cart.discounts|count > 0} in{/if}"> *}
<div id="promo-code" class="">
<div class="promo-code">
{block name='cart_voucher_form'}
<form action="{$urls.pages.cart}" data-link-action="add-voucher" method="post">
<input type="hidden" name="token" value="{$static_token}">
<input type="hidden" name="addDiscount" value="1">
<input class="promo-input" type="text" name="discount_name" placeholder="{l s='Promo code' d='Shop.Theme.Checkout'}">
<button type="submit" class="btn btn-primary"><span>{l s='Add' d='Shop.Theme.Actions'}</span></button>
{* <button type="submit" class="btn btn-primary"><span>{l s='Use' d='Shop.Theme.Actions'}</span></button> *}
<button type="submit" class="btn btn-primary"><span>Użyj</span></button>
</form>
{/block}
@@ -67,9 +69,9 @@
</div>
{/block}
<a class="collapse-button promo-code-button cancel-promo" role="button" data-toggle="collapse" data-target="#promo-code" aria-expanded="true" aria-controls="promo-code">
{* <a class="collapse-button promo-code-button cancel-promo" role="button" data-toggle="collapse" data-target="#promo-code" aria-expanded="true" aria-controls="promo-code">
{l s='Close' d='Shop.Theme.Checkout'}
</a>
</a> *}
</div>
</div>