Initial commit: is_shoppingcart out of the box. V3.0.1

This commit is contained in:
Isabelle Anno
2025-11-19 13:23:49 +01:00
commit 8135ee3594
70 changed files with 7864 additions and 0 deletions

View File

@ -0,0 +1,31 @@
{% extends '@PrestaShop/Admin/layout.html.twig' %}
{% form_theme configurationForm '@PrestaShop/Admin/TwigTemplateForm/prestashop_ui_kit.html.twig' %}
{% block content %}
{{ form_start(configurationForm) }}
<div class="row justify-content-center">
<div class="col-xl-12">
<div class="card">
<h3 class="card-header">
<i class="material-icons">settings</i> {{ 'Shopping cart configuration'|trans({}, translationDomain) }}
</h3>
<div class="card-block">
<div class="card-body">
<div class="form-wrapper">
{{ form_widget(configurationForm) }}
{{ form_rest(configurationForm) }}
</div>
</div>
</div>
<div class="card-footer">
<div class="d-flex justify-content-end">
<button class="btn btn-primary" id="form-maintenance-save-button">{{ 'Save'|trans({}, 'Admin.Actions') }}</button>
</div>
</div>
</div>
</div>
</div>
{% endblock %}

View File

@ -0,0 +1,34 @@
<?php
/**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to https://devdocs.prestashop.com/ for more information.
*
* @author PrestaShop SA and Contributors <contact@prestashop.com>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
*/
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header('Location: ../');
exit;

View File

@ -0,0 +1,63 @@
{**
* 2007-2020 PrestaShop and Contributors
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2020 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
<div class="cart-products">
<div class="cart-products__thumb">
{images_block webpEnabled=$webpEnabled}
<img {if $product.default_image}
{generateImagesSources image=$product.default_image size='cart_default' lazyload=false} {else}
src="{$urls.no_picture_image.bySize.cart_default.url}" {/if} alt="{$product.name|escape:'quotes'}"
class="img-fluid rounded" width="{$product.default_image.bySize.cart_default.width}"
height="{$product.default_image.bySize.cart_default.height}">
{/images_block}
</div>
<div class="cart-products__desc">
<p class="h6 mb-2 font-sm">
{$product.name}
</p>
<ul class="mb-2">
<li class="text-muted small">
<span>{l s='Quantity' d='Shop.Theme.Catalog'}:</span>
<span class="font-weight-bold">{$product.quantity}</span>
</li>
{foreach from=$product.attributes key="attribute" item="value"}
<li class="text-muted small">
<span>{$attribute}:</span>
<span class="font-weight-bold">{$value}</span>
</li>
{/foreach}
</ul>
<span class="price price--sm">
{$product.price}
</span>
</div>
<div class="cart-products__remove">
<a class="remove-from-cart text-danger" 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'}">
<span class="material-icons font-reset">
delete
</span>
</a>
</div>
</div>

View File

@ -0,0 +1,40 @@
{block name='blockcart_modal'}
<div class="modal fade" {block name='blockcart_modal_id'}{/block} tabindex="-1" aria-hidden="true">
<div class="modal-dialog">
{block name='blockcart_modal_content'}
<div class="modal-content">
{block name='blockcart_modal_header'}
<div class="modal-header">
{block name='blockcart_modal_title'}
<h5 class="modal-title">{$smaty.block.child}</h5>
{/block}
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
{/block}
{block name='blockcart_modal_body' hide}
<div class="modal-body">
{$smarty.block.child}
</div>
{/block}
{block name='blockcart_modal_footer' hide}
<div class="modal-footer">
{$smarty.block.child}
</div>
{/block}
</div>
{/block}
</div>
</div>
{/block}

View File

@ -0,0 +1,64 @@
{extends file='components/modal.tpl'}
{block name='modal_extra_attribues'}id="blockcart-modal"{/block}
{block name='modal_title'}{l s='Product added to cart' d='Modules.Isshoppingcart.Modalsuccess'}{/block}
{block name='modal_body'}
<div class="cart-products p-0 mb-4">
<div class="cart-products__thumb">
{images_block webpEnabled=$webpEnabled}
<img
class="img-fluid rounded"
{generateImagesSources image=$product.default_image size='cart_default' lazyload=false}
alt="{$product.cover.legend}"
title="{$product.cover.legend}">
{/images_block}
</div>
<div class="cart-products__desc">
<p class="h6 mb-2 font-sm">
{$product.name}
</p>
<div class="price price--sm">{$product.price}</div>
{hook h='displayProductPriceBlock' product=$product type="unit_price"}
</div>
</div>
<hr>
{if !empty($cart.subtotals.products.value)}
<div class="cart-summary-line mb-2">
<span class="label">{l s='Subtotal:' d='Modules.Isshoppingcart.Modalsuccess'}</span>
<span class="value">{$cart.subtotals.products.value}</span>
</div>
{/if}
{if !empty($cart.subtotals.shipping.value)}
<div class="cart-summary-line mb-2">
<span class="label">{l s='Shipping:' d='Modules.Isshoppingcart.Modalsuccess'}</span>
<span class="value">{$cart.subtotals.shipping.value} {hook h='displayCheckoutSubtotalDetails' subtotal=$cart.subtotals.shipping}</span>
</div>
{/if}
{if !$configuration.display_prices_tax_incl && $configuration.taxes_enabled}
<div class="cart-summary-line cart-total mb-2">
<span class="label">{$cart.totals.total.label}&nbsp;{$cart.labels.tax_short}</span>
<span class="value">{$cart.totals.total.value}</span>
</div>
<div class="cart-summary-line cart-total mb-0">
<span class="label">{$cart.totals.total_including_tax.label}</span>
<span class="value">{$cart.totals.total_including_tax.value}</span>
</div>
{else}
<div class="cart-summary-line cart-total mb-0">
<span class="label">{$cart.totals.total.label}&nbsp;{if $configuration.taxes_enabled}{$cart.labels.tax_short}{/if}</span>
<span class="value">{$cart.totals.total.value}</span>
</div>
{/if}
{/block}
{block name='modal_footer'}
<a href="{$cart_url}" class="btn btn-primary btn-block">{l s='Proceed to checkout' d='Shop.Theme.Actions'}</a>
<button type="button" class="btn btn-text btn-block" data-dismiss="modal">{l s='Continue shopping' d='Shop.Theme.Actions'}</button>
{/block}

View File

@ -0,0 +1,3 @@
{if $product}
{include file='module:is_shoppingcart/views/templates/front/modal-success.tpl'}
{/if}

View File

@ -0,0 +1,78 @@
{**
* 2007-2020 PrestaShop and Contributors
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2020 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
<div class="header-top__block header-top__block--cart col flex-grow-0">
<div class="js-blockcart blockcart cart-preview dropdown" data-refresh-url="{$refresh_url}">
<a href="#" role="button" id="cartDropdown" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"
class="header-top__link d-lg-block d-none">
<div class="header-top__icon-container">
<span class="header-top__icon material-icons">shopping_basket</span>
<span class="header-top__badge {if $cart.products_count > 9}header-top__badge--smaller{/if}">
{$cart.products_count}
</span>
</div>
</a>
<a href="{$cart_url}" class="d-flex d-lg-none header-top__link">
<div class="header-top__icon-container">
<span class="header-top__icon material-icons">shopping_basket</span>
<span class="header-top__badge {if $cart.products_count > 9}header-top__badge--smaller{/if}">
{$cart.products_count}
</span>
</div>
</a>
<div class="dropdown-menu blockcart__dropdown cart-dropdown dropdown-menu-right" aria-labelledby="cartDropdown">
<div class="cart-dropdown__content keep-open js-cart__card-body cart__card-body">
<div class="cart-loader">
<div class="spinner-border text-primary" role="status"><span
class="sr-only">{l s='Loading...' d='Shop.Theme.Global'}</span></div>
</div>
<div class="cart-dropdown__title d-flex align-items-center mb-3">
<p class="h5 mb-0 mr-2">
{l s='Your cart' d='Modules.Isshoppingcart.Isshoppingcart'}
</p>
<a data-toggle="dropdown" href="#" class="cart-dropdown__close dropdown-close ml-auto cursor-pointer text-decoration-none">
<i class="material-icons d-block">close</i>
</a>
</div>
{if $cart.products_count > 0}
<div class="cart-dropdown__products pt-3 mb-3">
{foreach from=$cart.products item=product}
{include 'module:is_shoppingcart/views/templates/front/is_shoppingcart-product-line.tpl' product=$product}
{/foreach}
</div>
<div class="cart-summary-line cart-total">
<span class="label">{$cart.totals.total.label}</span>
<span class="value">{$cart.totals.total.value}</span>
</div>
<div class="mt-3">
<a href="{$cart_url}" class="btn btn-sm btn-primary btn-block dropdown-close">
{l s='Proceed to checkout' d='Shop.Theme.Actions'}
</a>
</div>
{else}
<div class="alert alert-warning">
{l s='Unfortunately your basket is empty' d='Modules.Isshoppingcart.Isshoppingcart'}
</div>
{/if}
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,13 @@
{extends file='components/modal.tpl'}
{block name='modal_title'}{l s='Something went wrong' d='Modules.Isshoppingcart.Modalfail'}{/block}
{block name='modal_extra_attribues'}id="blockcart-error"{/block}
{block name='modal_body'}
<div class="alert alert-danger js-blockcart-alert">
</div>
{/block}
{block name='modal_footer'}
<button type="button" class="btn btn-secondary" data-dismiss="modal">{l s='Continue shopping' d='Shop.Theme.Actions'}</button>
{/block}

View File

@ -0,0 +1,34 @@
<?php
/**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to https://devdocs.prestashop.com/ for more information.
*
* @author PrestaShop SA and Contributors <contact@prestashop.com>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
*/
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header('Location: ../');
exit;