Jump to content

hideaki

Members
  • Posts

    52
  • Joined

  • Last visited

Profile Information

  • Activity
    Agency

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

hideaki's Achievements

Newbie

Newbie (1/14)

9

Reputation

1

Community Answers

  1. Hi guys, I've got this custom module that creates "Gift Cards" as Cart Rules. Basically this "Gift Card" has a value (e.g. $100) that the customers can use to reduce any amount from it (e.g. $20, which will leave $80 left in that particular gift card). However, I am having a bug now that will increase the value of the amount to use to the full amount of Total Products. For example, 1. Customer adds $16.50 worth of products to cart 2. Customer uses $10 from gift card with $100 ($90 should be left) 3. Customer increases quantity of product to 2 (total products price = $33) 4. Amount to use from gift card automatically becomes $33 (instead of $10) I've been working a whole day to resolve the problem, but can't seem to be going anywhere. So I've decided that I'll just remove the "Gift Card" cart rule instead. I've written something like this, but I have no idea where to fit it in. // SQL: SELECT DISTINCT `ccr`.`id_cart`, `ccr`.`id_cart_rule` FROM `ps_cart_cart_rule` AS `ccr` LEFT JOIN `ps_cart_rule_lang` AS `crl` ON `ccr`.`id_cart_rule` = `crl`.`id_cart_rule` WHERE `crl`.`name` LIKE '%gift card%' AND `ccr`.`id_cart` = 1 // CUSTOM: Remove Gift Card rules // Get the IDs of cart rules in cart $cartRulesInCart = Db::getInstance()->executeS('SELECT DISTINCT `ccr`.`id_cart_rule` FROM `'._DB_PREFIX_.'cart_cart_rule` AS `ccr` LEFT JOIN `'._DB_PREFIX_.'cart_rule_lang` AS `crl` ON `ccr`.`id_cart_rule` = `crl`.`id_cart_rule` WHERE `crl`.`name` LIKE \'%gift card%\' AND `ccr`.`id_cart` = '.(int)$this->id.''); // Remove cart rules with removeCartRule() foreach ($cartRulesInCart as $cartRuleIdToRemove) { $this->removeCartRule($cartRuleIdToRemove); } It should be in called when a product is added to cart, or quantity is changed on the Shopping Cart Summary. Any idea/s where I should place this? I have tried updateQty(), add() and update() functions in Cart.php but to no avail. Thanks for any help!
  2. Hey guys, When I try to remove a cart rule or a voucher, PS just leads me to this page, showing some plain text data about the cart rule, nothing more: http://weekend-edition.com/en/quick-order?deleteDiscount=9 10DOLLARSOFF10.00101. Site is at: http://weekend-edition.com/en/12-new-arrival Cart rule to use is 10DOLLARSOFF Any advice would be greatly appreciated as we are looking to launch tomorrow. Please, thanks!
  3. Did the hack as shown by removing the validate on product_name: http://www.prestashop.com/forums/topic/299078-property-orderdetail-total-price-tax-excl-is-not-valid/?do=findComment&comment=1734738
  4. Sure, here's my code for the resize() function in ImageManager. Do ensure that ImageMagick is enabled on your server! /** * Resize, cut and optimize image * * @param string $src_file Image object from $_FILE * @param string $dst_file Destination filename * @param integer $dst_width Desired width (optional) * @param integer $dst_height Desired height (optional) * @param string $file_type * @return boolean Operation result */ public static function resize($src_file, $dst_file, $dst_width = null, $dst_height = null, $file_type = 'jpg', $force_type = false, &$error = 0) { if (PHP_VERSION_ID < 50300) clearstatcache(); else clearstatcache(true, $src_file); if (!file_exists($src_file) || !filesize($src_file)) return !($error = self::ERROR_FILE_NOT_EXIST); list($src_width, $src_height, $type) = getimagesize($src_file); // If PS_IMAGE_QUALITY is activated, the generated image will be a PNG with .jpg as a file extension. // This allow for higher quality and for transparency. JPG source files will also benefit from a higher quality // because JPG reencoding by GD, even with max quality setting, degrades the image. if (Configuration::get('PS_IMAGE_QUALITY') == 'png_all' || (Configuration::get('PS_IMAGE_QUALITY') == 'png' && $type == IMAGETYPE_PNG) && !$force_type) $file_type = 'png'; if (!$src_width) return !($error = self::ERROR_FILE_WIDTH); if (!$dst_width) $dst_width = $src_width; if (!$dst_height) $dst_height = $src_height; //$src_image = ImageManager::create($type, $src_file); $src_image = new Imagick($src_file); $width_diff = $dst_width / $src_width; $height_diff = $dst_height / $src_height; if ($width_diff > 1 && $height_diff > 1) { $next_width = $src_width; $next_height = $src_height; } else { if (Configuration::get('PS_IMAGE_GENERATION_METHOD') == 2 || (!Configuration::get('PS_IMAGE_GENERATION_METHOD') && $width_diff < $height_diff)) { $next_height = $dst_height; $next_width = round(($src_width * $next_height) / $src_height); $dst_width = (int)(!Configuration::get('PS_IMAGE_GENERATION_METHOD') ? $dst_width : $next_width); } else { $next_width = $dst_width; $next_height = round($src_height * $dst_width / $src_width); $dst_height = (int)(!Configuration::get('PS_IMAGE_GENERATION_METHOD') ? $dst_height : $next_height); } } if (!ImageManager::checkImageMemoryLimit($src_file)) return !($error = self::ERROR_MEMORY_LIMIT); $dest_image = $src_image; $dest_image->resizeImage($dst_width, $dst_height, Imagick::FILTER_LANCZOS, 1); //$dest_image->writeImage('mythumb.gif'); //$dest_image->destroy(); //$dest_image = imagecreatetruecolor($dst_width, $dst_height); // If image is a PNG and the output is PNG, fill with transparency. Else fill with white background. /*if ($file_type == 'png' && $type == IMAGETYPE_PNG) { imagealphablending($dest_image, false); imagesavealpha($dest_image, true); $transparent = imagecolorallocatealpha($dest_image, 255, 255, 255, 127); imagefilledrectangle($dest_image, 0, 0, $dst_width, $dst_height, $transparent); } else { $white = imagecolorallocate($dest_image, 255, 255, 255); imagefilledrectangle ($dest_image, 0, 0, $dst_width, $dst_height, $white); }*/ /*imagecopyresampled($dest_image, $src_image, (int)(($dst_width - $next_width) / 2), (int)(($dst_height - $next_height) / 2), 0, 0, $next_width, $next_height, $src_width, $src_height);*/ //return (ImageManager::write($file_type, $dest_image, $dst_file)); return $dest_image->writeImage($dst_file); }
  5. Anyone can provide any advice? Running short on time for launch, and I'm faced with this..
  6. Thanks for your reply. On my OPC Shopping Cart Sunmary it's: Faded Short Sleeve T-Shirts Same as the actual product name, looks legit. It seems that payment by Check is also getting this issue. Where else could go wrong?
  7. I'm also getting these errors from cron via email if it would help: PHP Notice: Undefined index: REQUEST_URI in /home/weekende/public_html/classes/shop/Shop.php on line 319 <br /> <b>Notice</b>: Undefined index: REQUEST_URI in <b>/home/weekende/public_html/classes/shop/Shop.php</b> on line <b>319</b><br /> PHP Notice: Undefined index: SCRIPT_NAME in /home/weekende/public_html/classes/shop/Shop.php on line 372 <br /> <b>Notice</b>: Undefined index: SCRIPT_NAME in <b>/home/weekende/public_html/classes/shop/Shop.php</b> on line <b>372</b><br /> PHP Notice: Undefined index: SCRIPT_NAME in /home/weekende/public_html/classes/Link.php on line 47 <br /> <b>Notice</b>: Undefined index: SCRIPT_NAME in <b>/home/weekende/public_html/classes/Link.php</b> on line <b>47</b><br /> PHP Notice: Undefined index: SCRIPT_NAME in /home/weekende/public_html/classes/Link.php on line 47 PHP Notice: Undefined index: REQUEST_URI in /home/weekende/public_html/classes/controller/FrontController.php on line 278 PHP Notice: Undefined index: REQUEST_URI in /home/weekende/public_html/classes/controller/FrontController.php on line 287 PHP Notice: Undefined index: REQUEST_URI in /home/weekende/public_html/classes/controller/FrontController.php on line 336 <br /> <b>Notice</b>: Undefined index: SCRIPT_NAME in <b>/home/weekende/public_html/classes/Link.php</b> on line <b>47</b><br /> <br /> <b>Notice</b>: Undefined index: REQUEST_URI in <b>/home/weekende/public_html/classes/controller/FrontController.php</b> on line <b>278</b><br /> <br /> <b>Notice</b>: Undefined index: REQUEST_URI in <b>/home/weekende/public_html/classes/controller/FrontController.php</b> on line <b>287</b><br /> <br /> <b>Notice</b>: Undefined index: REQUEST_URI in <b>/home/weekende/public_html/classes/controller/FrontController.php</b> on line <b>336</b><br /> Please, any help where I can start looking for mistakes will be greatly appreciated!
  8. Reinstalled the module and cleared cache, but to no avail. More debugging info if this helps: Notice on line 119 in file /home/weekende/public_html/cache/smarty/compile/0c/7f/f8/0c7ff8d8e27626cd2303eaf24c06deb2a2ee7f76.file.view.tpl.php [8] Trying to get property of non-object Notice on line 119 in file /home/weekende/public_html/cache/smarty/compile/0c/7f/f8/0c7ff8d8e27626cd2303eaf24c06deb2a2ee7f76.file.view.tpl.php [8] Trying to get property of non-object Notice on line 119 in file /home/weekende/public_html/cache/smarty/compile/0c/7f/f8/0c7ff8d8e27626cd2303eaf24c06deb2a2ee7f76.file.view.tpl.php [8] Trying to get property of non-object Notice on line 119 in file /home/weekende/public_html/cache/smarty/compile/0c/7f/f8/0c7ff8d8e27626cd2303eaf24c06deb2a2ee7f76.file.view.tpl.php [8] Trying to get property of non-object Notice on line 119 in file /home/weekende/public_html/cache/smarty/compile/0c/7f/f8/0c7ff8d8e27626cd2303eaf24c06deb2a2ee7f76.file.view.tpl.php [8] Trying to get property of non-object Notice on line 119 in file /home/weekende/public_html/cache/smarty/compile/0c/7f/f8/0c7ff8d8e27626cd2303eaf24c06deb2a2ee7f76.file.view.tpl.php [8] Trying to get property of non-object Notice on line 119 in file /home/weekende/public_html/cache/smarty/compile/0c/7f/f8/0c7ff8d8e27626cd2303eaf24c06deb2a2ee7f76.file.view.tpl.php [8] Trying to get property of non-object Notice on line 119 in file /home/weekende/public_html/cache/smarty/compile/0c/7f/f8/0c7ff8d8e27626cd2303eaf24c06deb2a2ee7f76.file.view.tpl.php [8] Trying to get property of non-object Notice on line 119 in file /home/weekende/public_html/cache/smarty/compile/0c/7f/f8/0c7ff8d8e27626cd2303eaf24c06deb2a2ee7f76.file.view.tpl.php [8] Trying to get property of non-object Notice on line 119 in file /home/weekende/public_html/cache/smarty/compile/0c/7f/f8/0c7ff8d8e27626cd2303eaf24c06deb2a2ee7f76.file.view.tpl.php [8] Trying to get property of non-object Notice on line 119 in file /home/weekende/public_html/cache/smarty/compile/0c/7f/f8/0c7ff8d8e27626cd2303eaf24c06deb2a2ee7f76.file.view.tpl.php [8] Trying to get property of non-object Notice on line 119 in file /home/weekende/public_html/cache/smarty/compile/0c/7f/f8/0c7ff8d8e27626cd2303eaf24c06deb2a2ee7f76.file.view.tpl.php [8] Trying to get property of non-object Notice on line 350 in file /home/weekende/public_html/cache/smarty/compile/0c/7f/f8/0c7ff8d8e27626cd2303eaf24c06deb2a2ee7f76.file.view.tpl.php [8] Trying to get property of non-object Notice on line 350 in file /home/weekende/public_html/cache/smarty/compile/0c/7f/f8/0c7ff8d8e27626cd2303eaf24c06deb2a2ee7f76.file.view.tpl.php [8] Trying to get property of non-object Notice on line 350 in file /home/weekende/public_html/cache/smarty/compile/0c/7f/f8/0c7ff8d8e27626cd2303eaf24c06deb2a2ee7f76.file.view.tpl.php [8] Trying to get property of non-object Notice on line 350 in file /home/weekende/public_html/cache/smarty/compile/0c/7f/f8/0c7ff8d8e27626cd2303eaf24c06deb2a2ee7f76.file.view.tpl.php [8] Trying to get property of non-object Notice on line 350 in file /home/weekende/public_html/cache/smarty/compile/0c/7f/f8/0c7ff8d8e27626cd2303eaf24c06deb2a2ee7f76.file.view.tpl.php [8] Trying to get property of non-object Notice on line 350 in file /home/weekende/public_html/cache/smarty/compile/0c/7f/f8/0c7ff8d8e27626cd2303eaf24c06deb2a2ee7f76.file.view.tpl.php [8] Trying to get property of non-object Notice on line 350 in file /home/weekende/public_html/cache/smarty/compile/0c/7f/f8/0c7ff8d8e27626cd2303eaf24c06deb2a2ee7f76.file.view.tpl.php [8] Trying to get property of non-object Notice on line 350 in file /home/weekende/public_html/cache/smarty/compile/0c/7f/f8/0c7ff8d8e27626cd2303eaf24c06deb2a2ee7f76.file.view.tpl.php [8] Trying to get property of non-object Notice on line 350 in file /home/weekende/public_html/cache/smarty/compile/0c/7f/f8/0c7ff8d8e27626cd2303eaf24c06deb2a2ee7f76.file.view.tpl.php [8] Trying to get property of non-object Notice on line 350 in file /home/weekende/public_html/cache/smarty/compile/0c/7f/f8/0c7ff8d8e27626cd2303eaf24c06deb2a2ee7f76.file.view.tpl.php [8] Trying to get property of non-object Notice on line 350 in file /home/weekende/public_html/cache/smarty/compile/0c/7f/f8/0c7ff8d8e27626cd2303eaf24c06deb2a2ee7f76.file.view.tpl.php [8] Trying to get property of non-object Notice on line 350 in file /home/weekende/public_html/cache/smarty/compile/0c/7f/f8/0c7ff8d8e27626cd2303eaf24c06deb2a2ee7f76.file.view.tpl.php [8] Trying to get property of non-object
  9. Hi guys, I am getting this error when I am trying to confirm my order with bank wire: [PrestaShopException]Property OrderDetail->product_name is not valid at line 837 in file classes/ObjectModel.php 831. 832. $message = $this->validateField($field, $this->$field); 833. if ($message !== true) 834. { 835. if ($die) 836. throw new PrestaShopException($message); 837. return $error_return ? $message : false; 838. } 839. } 840. 841. return true; ObjectModelCore->validateFields - [line 255 - classes/ObjectModel.php] ObjectModelCore->getFields - [line 455 - classes/ObjectModel.php] ObjectModelCore->add - [line 417 - classes/ObjectModel.php] - [2 Arguments] ObjectModelCore->save - [line 589 - classes/order/OrderDetail.php] OrderDetailCore->create - [line 613 - classes/order/OrderDetail.php] - [7 Arguments] OrderDetailCore->createList - [line 292 - classes/PaymentModule.php] - [7 Arguments] PaymentModuleCore->validateOrder - [line 64 - modules/bankwire/controllers/front/validation.php] - [9 Arguments] BankwireValidationModuleFrontController->postProcess - [line 171 - classes/controller/Controller.php] ControllerCore->run - [line 373 - classes/Dispatcher.php] DispatcherCore->dispatch - [line 28 - index.php] Any idea why is this happening? Thanks! You can try it at the site: http://weekend-edition.com/en/12-new-arrival Thanks!
×
×
  • Create New...