Jump to content

Problem with Customized Data


Recommended Posts

Hi,

 

I am using PS 1.4 and looking to check whether user upload file or not before adding product to cart. If user tick radio button I will upload my image now then it's mandatory to upload image otherwise error should occur else allowed to add to cart. My website is at

http://royalportrait.in/rpshop/product.php?id_product=35

 

Could someone please help me? I tried below code at CartController.php

 

 /* Check the quantity availability */
 if ($idProductAttribute AND is_numeric($idProductAttribute))
 {
  if (!$delete AND !$producToAdd->isAvailableWhenOutOfStock($producToAdd->out_of_stock) AND !Attribute::checkAttributeQty((int)$idProductAttribute, (int)$qty))
   if (Tools::getValue('ajax') == 'true')
    die('{"hasError" : true, "errors" : ["'.Tools::displayError('There is not enough product in stock.', false).'"]}');
   else
    $this->errors[] = Tools::displayError('There is not enough product in stock.');
 }
 /* Error if image not upload*/
 elseif(Tools::getValue('imagemethod')=='imgbyupload')
 {
  $this->errors[] = Tools::displayError('Please upload image before Add to Cart.');
 }
 /* End if image not upload*/

Link to comment
Share on other sites

×
×
  • Create New...