This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// To be placed in /themes/[current theme]/assets/js/dynamic/custom.js (create the "dynamic" folder) | |
window.dp_hook = '[data-widget_type="product-variants.default"]' | |
window.dp_price_hook = ".ce-product-price span" | |
$(document).on("dp-loaded", function () { | |
const addToCart = ceFrontend.utils.urlActions.actions.addToCart; | |
ceFrontend.utils.urlActions.actions.addToCart = function (e) { | |
window.dpSaveCustomization(true).then(function (response) { | |
if (response) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Tailwind's Preflight Style Reset | |
* https://tailwindcss.com/docs/preflight | |
* | |
* Why is this here? | |
* 1. Tailwind doesn't publish their style reset (which is | |
* derived from modern-normalize). | |
* 2. TailwindCSS's version of this doesn't work with third-party | |
* DOM elements that it can't extract. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cy.visit('/404') | |
//=> Test fails | |
cy.visit('/404', {failOnStatusCode: false}) | |
//=> Test passes but does not test the HTTP code was 404 | |
cy.request({url: '/404', failOnStatusCode: false}).its('status').should('equal', 404) | |
cy.visit('/404', {failOnStatusCode: false}) | |
//=> Test passes, tests that the HTTP code was 404, and tests page was visited |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.dp_group_options_qty .content { | |
display: grid; | |
grid-auto-flow: column; | |
grid-template-rows: 1fr 1fr; | |
grid-auto-columns: auto; | |
justify-items: center; | |
justify-content: start; | |
column-gap: .5rem; | |
row-gap: 0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** @var $id_product */ | |
/* @var DynamicInputField[] $input_fields */ | |
/* @var $dropdown */ | |
/* @var $dropdown_ref */ | |
use DynamicProduct\classes\models\dynamic_fields\DropDownField; | |
use DynamicProduct\classes\models\DynamicField; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// The ID of the current product | |
/** @var int $id_product */ | |
// The selected combination ID | |
/** @var int $id_attribute */ | |
// The current selected quantity | |
/** @var int $quantity */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{** If product has a required customization field **} | |
{if $product.customizable == 2} | |
show link | |
{else} | |
show cart btn | |
{/if} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { defineConfig } from 'cypress'; | |
import { seed } from './cypress/plugins/seed'; | |
import vitePreprocessor from 'cypress-vite'; | |
export default defineConfig({ | |
video: false, | |
e2e: { | |
baseUrl: 'http://localhost:5173', | |
specPattern: '**/*.cy.ts', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Product extends ProductCore | |
{ | |
public static function getPriceStatic($id_product, $usetax = true, $id_product_attribute = null, $decimals = 6, $divisor = null, $only_reduc = false, $usereduc = true, $quantity = 1, $force_associated_tax = false, $id_customer = null, $id_cart = null, $id_address = null, &$specific_price_output = null, $with_ecotax = true, $use_group_reduction = true, Context $context = null, $use_customer_price = true, $id_customization = null) | |
{ | |
// si HT, on désactive l'ecotaxe | |
if (!$usetax) { | |
$with_ecotax = false; | |
} | |
return parent::getPriceStatic($id_product, $usetax, $id_product_attribute, $decimals, $divisor, $only_reduc, $usereduc, $quantity, $force_associated_tax, $id_customer, $id_cart, $id_address, $specific_price_output, $with_ecotax, $use_group_reduction, $context, $use_customer_price, $id_customization); // TODO: Change the autogenerated stub |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document.addEventListener('dp-loaded', function() { | |
const field_name = 'price_wt'; | |
window.dp_calc.subscribe(function(calc) { | |
if (!calc.input_fields || !calc.input_fields[field_name]) return | |
$('.precio_IVA').text(calc.input_fields[field_name].value_formatted) | |
}) | |
}); |
NewerOlder