update
This commit is contained in:
@@ -73,11 +73,10 @@
|
||||
$begin_checkout_items .= ',';
|
||||
|
||||
$begin_checkout_items .= '{';
|
||||
$begin_checkout_items .= '"item_id": "' . $product['id'] . '",';
|
||||
$begin_checkout_items .= '"item_name": "' . str_replace( '"', '', $product['language']['name'] ) . '",';
|
||||
$begin_checkout_items .= '"id": "' . $product['id'] . '",';
|
||||
$begin_checkout_items .= '"name": "' . $product['language']['name'] . '",';
|
||||
$begin_checkout_items .= '"price": ' . \Shared\Helpers\Helpers::normalize_decimal( $price_product['price_new'] ) . ',';
|
||||
$begin_checkout_items .= '"quantity": ' . (int)$position['quantity'] . ',';
|
||||
$begin_checkout_items .= '"google_business_vertical": "retail"';
|
||||
$begin_checkout_items .= '"quantity": ' . $position['quantity'];
|
||||
$begin_checkout_items .= '}';
|
||||
?>
|
||||
<? endforeach;?>
|
||||
@@ -153,22 +152,18 @@
|
||||
<? endif;?>
|
||||
</div>
|
||||
<script class="footer" type="text/javascript">
|
||||
var orderForm = document.getElementById('form-order');
|
||||
var orderSendButton = document.getElementById('order-send');
|
||||
|
||||
if (orderForm && orderSendButton) {
|
||||
orderForm.addEventListener('submit', function(event) {
|
||||
if (orderSendButton.disabled) {
|
||||
event.preventDefault();
|
||||
return;
|
||||
}
|
||||
|
||||
orderSendButton.classList.add('loading-button');
|
||||
orderSendButton.disabled = true;
|
||||
});
|
||||
}
|
||||
document.getElementById('order-send').addEventListener('click', function() {
|
||||
var form = document.getElementById('form-order'); // Zastąp 'form-id' rzeczywistym ID Twojego formularza
|
||||
if (form.checkValidity()) {
|
||||
this.classList.add('loading-button');
|
||||
this.disabled = true;
|
||||
form.submit();
|
||||
} else {
|
||||
// Opcjonalnie: wywołaj funkcję reportValidity(), aby wyświetlić komunikaty o błędach formularza
|
||||
form.reportValidity();
|
||||
}
|
||||
});
|
||||
<? if ( $this -> settings['google_tag_manager_id'] ):?>
|
||||
dataLayer.push({ ecommerce: null });
|
||||
dataLayer.push({
|
||||
event: "begin_checkout",
|
||||
ecommerce: {
|
||||
|
||||
Reference in New Issue
Block a user