Jump to content

Search the Community

Showing results for tags 'ajaxCart'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Community Help and Support
    • PrestaShop Download
    • PrestaShop Marketplace
  • News and Announcements
    • PrestaShop news and releases
    • PrestaShop Beta
    • PrestaShop Blogs
    • PrestaShop Meetups
  • International community (English)
    • General topics
    • PrestaShop Merchants
    • PrestaShop Developers
    • Taxes, Translations & Laws
    • Community Modules and Themes
  • Forum francophone
    • Discussion générale
    • Aide et support communautaire
    • PrestaShop pour les marchands
    • PrestaShop pour les développeurs
    • Adaptation aux lois Québécoises
    • Modules et thèmes gratuits
    • Modules et thèmes payants
  • Foro en Español
    • Discusión general
    • Soporte de la comunidad y ayuda
    • Comerciantes PrestaShop
    • Desarrolladores PrestaShop
    • Módulos y plantillas gratuitas
  • Forum italiano
    • Forum generale
    • Aiuto e supporto della Community
    • Commercianti PrestaShop
    • Sviluppatori PrestaShop
    • Aspetti legali sull'eCommerce
    • Moduli e template gratuiti
  • Deutsches Forum
    • Generelle Fragen
    • Support und Hilfe aus der Community
    • e-Commerce/Versand-Handel mit Prestashop
    • Prestashop-Entwickler
    • Anpassung an deutsches Recht
    • Kostenlose Module und Templates
    • Generelle Fragen Copy
  • Nederlandstalig forum
    • Algemeen
    • Hulp en ondersteuning, van en voor de community
    • PrestaShop-winkeliers
    • PrestaShop-ontwikkelaars
    • Het aanpassen van PrestaShop
    • Gratis modules en templates
  • Fórum em Português
    • Fórum Geral
    • Ajuda e Suporte da Comunidade
    • Lojistas que utilizam o PrestaShop
    • Desenvolvedores PrestaShop
    • Legislação específica
    • Módulos e temas gratuitos
  • Polskie forum
    • Forum ogólne
    • Wsparcie i pomoc użytkowników
    • Oferty twórców PrestaShop
    • Deweloperzy PrestaShop
    • Darmowe Moduły i Szablony
  • Dansk forum
    • Generelt forum
    • Hjælp og support fra fællesskabet
    • PrestaShop for købmænd
    • PrestaShop for udviklere
    • Love og regler
    • Gratis moduler og temaer
  • České fórum
    • Instalasi, Konfigurasi dan upgrade
    • Obecná diskuze
    • Bezplatné moduly a šablony
    • PrestaShop vývojáři
    • PrestaShop obchodníci
  • Bahasa Indonesia
    • Diskusi Umum
    • Podpora a pomoc komunity
    • Laporan Bug
    • Jasa, Promosi & Lowongan Kerja
  • Svenskt forum
    • Allmän diskussion
    • Installation, konfigurering och uppdatering
  • Forumul românesc
    • Discuţii generale
    • Instalare, configurare şi upgrade
  • Pусский язык
    • Обсуждение скрипта
    • Установка, Настройка, Обновление
    • Прием багов
  • Slovenské fórum
    • Všeobecná diskusia
    • Podpora a pomoc komunity
    • PrestaShop obchodníci
    • PrestaShop vývojári
    • Bezplatné moduly a šablóny
  • Türkçe Topluluğu
    • Genel Konular
    • Topluluk desteği ve yardım
    • PrestaShop Tüccarları
    • Prestashop Geliştiricileri
    • Ücretsiz Modül ve Temalar
  • Diễn đàn tiếng Việt
    • Thảo luận chung
    • Hỗ trợ từ cộng đồng
    • Dành cho chủ doanh nghiệp / cửa hàng
    • Dành cho lập trình viên
  • PrestaShop Communities
    • اللغه العربيه [Arabic]
    • Ελληνικά [Greek]
    • עִבְרִית [Hebrew]
    • 中文
    • Magyar [Hungarian]
    • 日本語 [Japanese]
    • Lietuviškai [Lithuanian]
    • انجمن فارسی [Persian]
    • ไทย [Thai]
    • Malaysia [Malaysian]
    • Eesti [Estonian]
    • Slovenščina [Slovenian]
    • Српски [Serbian]
  • IP. Board Forum
    • IP. Board Forum Questions and Issues
  • Archive
    • Zapłać Moduły i Szablony [ARCHIVE]
    • Moduly, upravy a dizajn [ARCHIVE]
    • Phát triển và các mô-đun [ARCHIVE]
    • Yazılım, Modül ve Tema [ARCHIVE]
    • Модули, Шаблоны [ARCHIVE]
    • Module şi teme [ARCHIVE]
    • Pengembangan dan Modul [ARCHIVE]
    • Moduler och teman [ARCHIVE]
    • Ecommerce x PrestaShop [ARCHIVE BOARD]
    • Vývoj a moduly [ARCHIVE]
    • Kostenpflichtige Module, Templates [ARCHIVE]
    • Módulos y temas pagos [ARCHIVE]
    • Módulos e temas pagos [ARCHIVE]
    • Servizi commerciali [ARCHIVE]
    • Forum - Feedback Contributor
    • PrestaShop Cloud

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Found 7 results

  1. <?php use Symfony\Component\HttpFoundation\JsonResponse; class ReaddToCartModuleFrontController extends ModuleFrontController { public $ajax = true; public function initContent() { parent::initContent(); $productId = Tools::getValue('id_product'); $quantity = Tools::getValue('qty', 1); // Debugging output error_log("Product ID: " . $productId); error_log("Quantity: " . $quantity); if (!$productId || !Validate::isUnsignedId($productId)) { error_log("Invalid product ID: " . $productId); $this->ajaxDie(json_encode(['success' => false, 'message' => 'Invalid product ID'])); } $cart = $this->context->cart; if (!$cart->id) { $cart->add(); $this->context->cookie->id_cart = $cart->id; } $updateQuantity = $cart->updateQty($quantity, $productId); if ($updateQuantity) { error_log("Product added to cart successfully"); $this->ajaxDie(json_encode(['success' => true, 'message' => 'Product added to cart'])); } else { error_log("Failed to add product to cart"); $this->ajaxDie(json_encode(['success' => false, 'message' => 'Failed to add product to cart'])); } } }
  2. I'm trying to get the token used for the AJAX requests, but I can't I've tried to var tokenElement = document.querySelector('input[name="token"]'); return tokenElement ? tokenElement.value : ''; but this returns empty string My AJAX request is function updateCartQuantity(productId, newQuantity, direction) { var updateCartUrl = 'http://localhost:8080/carrito?update=1&id_product=' + productId + '&id_product_attribute=0&token='+ tokenElement +'&ajax=1&op='+direction ; $.ajax({ type: 'GET', url: updateCartUrl, success: function (response) refreshCart(); }, error: function (error) { console.error('Error updating:', error); } }); } But since the variable arrives empty, the request does not work for me, if I put a token written on the js, the request works correctly (I have copied and pasted the token that I use to check that the request works from another request that Prestashop has, but I can't access how this token is generated)
  3. Hello, Is it possible to get the Ajaxcart working properly in Prestashop 1.7. Currently if set to YES the Ajaxcart works correctly, but if set to NO it doesn't work properly. I want it to be able to work correctly in both the YES and NO options. I have found the following workaround for making the cart work correctly when the switch is on NO, but it causes problems when in the switch is on YES. if (resp.modal) { showModal(resp.modal); } changed to if (resp.modal) { window.location.href=cart_url; } With this it does go to the Cart Summary page, but if you put the switch to YES it loads the Ajaxcart for a fraction of a second then goes to the Cart Summary page, which is not what I want. If anybody can help with this problem it would be appreciated. Thank you. Kathy
  4. Hi guys and girls, Can you please help me with this issue. My add to cart suddently stopped working. When we press add to cart, there is no response. The cart remains empty. This happens from google chrome , Firefox , internet and also from any mobile . I did not have this issue before . I have not installed any new module. I have uninstalled and reinstalled the shopping cart module, and the problem still exists. The page gets updated, but nothing get added to the shopping cart, so the cart stays empty. Steps to reproduce the behavior: Go to https://benush.es/en/all_products/35-milk-chocolate-tablet-14 Click on Add to Cart See that Cart icon stays empty Additionnal information I use prestashop 1.7.6.2 PHP version: 7.2.34 Thanks in advanced
  5. Hello everyone, I have trouble with my prestashop theme. When I press on login icon in the blockuserinfo the ajax cart is also opening! I tried to move the icon from the cart, but it is still opening. I think the problem is in blockuserinfo.tpl that they are both in the same <section> But I tried to seperate them and cart stopped to expand. The link to the site, that you could see the problem: http://vannalux.kz/ blockuserinfo.tpl <section id="header_user" class="blockuserinfo-cart header-box"> {if !$PS_CATALOG_MODE} <div id="shopping_cart"> <a href="{$link->getPageLink($order_process, true)}" title="{l s='View my shopping cart' mod='blockuserinfo'}" rel="nofollow"> <strong class="opancart"></strong> <span class="shopping_cart_title">{l s='Cart' mod='blockuserinfo'}</span> <span class="ajax_cart_quantity{if $cart_qties == 0} hidden{/if}">{$cart_qties}</span> <span class="ajax_cart_product_txt{if $cart_qties != 1} hidden{/if}">{l s='Product' mod='blockuserinfo'}</span> <span class="ajax_cart_product_txt_s{if $cart_qties < 2} hidden{/if}">{l s='Products' mod='blockuserinfo'}</span> {*<span class="price ajax_cart_total{if $cart_qties == 0} hidden{/if}"> {if $cart_qties > 0} {if $priceDisplay == 1} {assign var='blockuser_cart_flag' value='Cart::BOTH_WITHOUT_SHIPPING'|constant} {convertPrice price=$cart->getOrderTotal(false, $blockuser_cart_flag)} {else} {assign var='blockuser_cart_flag' value='Cart::BOTH_WITHOUT_SHIPPING'|constant} {convertPrice price=$cart->getOrderTotal(true, $blockuser_cart_flag)} {/if} {/if} </span>*} <span class="ajax_cart_no_product{if $cart_qties > 0} hidden{/if}">{l s='(empty)' mod='blockuserinfo'}</span> </a> </div> {/if} <div class="blockuserinfo header-box"> {if $logged} <a href="{$link->getPageLink('index', true, NULL, "mylogout")}" title="{l s='Log out' mod='blockuserinfo'}" class="logout" rel="tooltip" data-placement="bottom" data-original-title="first tooltip"><span><i class="icon-lock"></i></span></a> <a href="{$link->getPageLink('my-account', true)|escape:'html'}" title="{l s='View my customer account' mod='blockuserinfo'}" class="account" rel="nofollow"><span>{$cookie->customer_firstname} {$cookie->customer_lastname}</span></a> {else} <a href="{$link->getPageLink('my-account', true)}" title="{l s='Login' mod='blockuserinfo'}" class="login" rel="tooltip" data-placement="bottom" data-original-title="first tooltip" ><span><i class="icon-unlock"></i></span></a> {/if} </div> </section> Please help me to solve this problem, thanks!
  6. Bonjour, Je rencontre actuellement un problème lors de l'ajout d'un produit au panier. Le problème est apparu du jour au lendemain sans qu'il n'y ai eu de changement sur le site. La version de prestashop est la 1.5.6.0 A l'origine le panier "Ajax" était activé, une alerte javascript retournait "ok." lors du click. Le json retourné par la requête est : {"hasError":true,"errors":["ok."]} Après désactivation du mode Ajax idem, sauf que le message d'erreur apparaît sur la page panier : J'ai tenté essayé de créer un nouveau produit, idem. Est-ce que quelqu'un aurait déjà rencontré ce problème ? Notre boutique est bloqué depuis ce matin nos clients ne peuvent plus rien commander.
  7. Hello, Que signifie le paramètre callerElement dans la méthode : ajaxCart.add = function(idProduct, idCombination, addedFromProductPage, callerElement, quantity, whishlist) Je ne le trouve pas dans la doc prestashop. Merci.
×
×
  • Create New...