Jump to content

prabhakaran3492

Members
  • Posts

    9
  • Joined

  • Last visited

  • Days Won

    1

prabhakaran3492 last won the day on December 12 2022

prabhakaran3492 had the most liked content!

About prabhakaran3492

  • Birthday 04/03/1992

Profile Information

  • Location
    Chennai
  • First Name
    Prabhakaran
  • Last Name
    A

Recent Profile Visitors

246 profile views

prabhakaran3492's Achievements

Newbie

Newbie (1/14)

2

Reputation

  1. I add the product to cart from my custom module by using the following code. It's working. My Javascript file var pid = $('#product_id').val(); $.ajax({ url : url+'&action=savecustomdataAction', type : "POST", data : { customdata : customdata, qty : 1, pid : pid }, success : function(response) { if(response.message == true) { $('#addtocart_form').submit(); } } }); My .tpl file <script> var url ="{url entity='module' name='appcustomizer' controller='ajaxfunc' params = []}"; </script> <form name="addtocart" id="addtocart_form" method="POST" action="{$urls.pages.cart}"> <input type="hidden" name="id_product" id="product_id" value="{Tools::getValue('pid')}" /> <input type="hidden" name="token" value="{$static_token}"> // Your Code Here... <input type="submit" id="addtocart" class="cart-btn" value="Add To Cart" /> My Custom Controller public function displayAjaxsavecustomdataAction() { $customData = Tools::getValue('customdata'); $idProduct = Tools::getValue('pid'); // for me it's always one $qty=Tools::getValue('qty'); // always add one item $attribute = 74; // get cart id if exists if ($this->context->cookie->id_cart) { $cart = new Cart($this->context->cookie->id_cart); } // create new cart if needed if (!isset($cart) OR !$cart->id) { $cart = new Cart($this->context->cookie->id_cart); $cart->id_customer = (int)($this->context->cookie->id_customer); $cart->id_address_delivery = (int) (Address::getFirstCustomerAddressId($cart->id_customer)); $cart->id_address_invoice = $cart->id_address_delivery; $cart->id_lang = (int)($this->context->cookie->id_lang); $cart->id_currency = (int)($this->context->cookie->id_currency); $cart->id_carrier = 1; $cart->recyclable = 0; $cart->gift = 0; $cart->add(); $this->context->cookie->id_cart = (int)($cart->id); } // get product to add into cart $productToAdd = new Product((int)($idProduct), true, (int)($this->context->cookie->id_lang)); $cart->update(); $cart = $this->context->cart; $updateQuantity = $cart->updateQty((int)($qty), (int)($idProduct),(int)($attribute), false); $cart->update(); header('Content-Type: application/json'); die(Tools::jsonEncode(['message' => true])); }
  2. Hi Nishith, Thank you lot, I got the solution as I expected. It's be work
  3. Hi Nishith, Thanks for your reply. I Changed the option "Use PNG for all images" and upload the images but still images are "jpg" exrtension only.
  4. Hi all, In Prestashop 1.7 all the product images save as "jpg" format. I want to save all the product image as PNG format. Am a new to prestashop, Please anybody help me to save the images as PNG format. Thanks,
  5. Hi Every one, I need to add the custom button under the price section in home page, to navigate the custom page. Please any one help me. Thanks,
  6. Hi Guys, Please anybody help me guys, am new to prestashop.
  7. Hi Every one, I need to add the custom button under the price section in home page, to navigate the custom page. Please any one help me. Thanks,
  8. Hello, I've just created my module, I can see it in the back-office but when I click Install, I have the following error message : Cannot install module testmodule. Unfortunately, the module did not return additional details.
  9. Hello, I've just created my module, I can see it in the back-office but when I click Install, I have the following error message : Cannot install module testmodule. Unfortunately, the module did not return additional details.
×
×
  • Create New...