Jump to content

prestatent

Members
  • Posts

    373
  • Joined

  • Last visited

Profile Information

  • Location
    Scotland
  • Activity
    Developer

Recent Profile Visitors

11,235,242 profile views

prestatent's Achievements

  1. Hi Fabry Thanks for pointing me to this. I'll have a look. Appreciate it. Cheers
  2. PS 1.7.5 Hi We have a problem related to this which is a pain in the ... If we have 4 images on a product (these include additional images such as lifestyle, floorplans, etc), and one of each colour on the 3 different combinations we would have 7 images in all (screen 1). The way the flow from category list page works is that there is a default image for each combination, when I click on the product on the category list page to take me to the product page, I will only see the image for that combination and not all of the other 7 images (screen 2). To compound the issue, the link on the product page - "display all pictures" - available upto PS1.6 has been removed in 1.7 (screen 3). This means that I will never be able to see all the images, only the image assigned to each combination. This is a flaw and a backward step IMO. The fact that I cannot remove the "id_product_attribute" from the route-to-products field in "SEO & URLS" is baffling. If anyone from PS can explain the thinking behind this change it would be appreciated because I cannot see the benefits. Also, if anyone has a fix or override to get round this flaw I would be very grateful. Thanks
  3. Thanks for your reply Rolige. I've tried this but still doesn't work. Will have to make a note of this, should I upgrade in the future. Cheers
  4. PS 1.6.0.8 Hi I'm trying to create an override for the mailaerts module to display the product description on the confirmation email. It doesn't seem to work. When I put the same code into the core code, it works ok. Code placed in /overrides/modules/mailalerts. The method is "hookActionValidateOrder": Possibly the issue is the placement of line: return parent::hookActionValidateOrder($params); See code below. Any help appreciated. Thanks <?php if (!defined('_CAN_LOAD_FILES_')) exit; include_once(dirname(__FILE__).'/MailAlert.php'); class MailAlertsOverride extends MailAlerts { public function hookActionValidateOrder($params) { if (!$this->merchant_order || empty($this->merchant_mails)) return; // Getting differents vars $context = Context::getContext(); $id_lang = (int)$context->language->id; $id_shop = (int)$context->shop->id; $currency = $params['currency']; $order = $params['order']; $customer = $params['customer']; $configuration = Configuration::getMultiple( array( 'PS_SHOP_EMAIL', 'PS_MAIL_METHOD', 'PS_MAIL_SERVER', 'PS_MAIL_USER', 'PS_MAIL_PASSWD', 'PS_SHOP_NAME', 'PS_MAIL_COLOR' ), $id_lang, null, $id_shop ); $delivery = new Address((int)$order->id_address_delivery); $invoice = new Address((int)$order->id_address_invoice); $order_date_text = Tools::displayDate($order->date_add); $carrier = new Carrier((int)$order->id_carrier); $message = $this->getAllMessages($order->id); if (!$message || empty($message)) $message = $this->l('No message'); $items_table = ''; $products = $params['order']->getProducts(); $customized_datas = Product::getAllCustomizedDatas((int)$params['cart']->id); Product::addCustomizationPrice($products, $customized_datas); foreach ($products as $key => $product) { $unit_price = Product::getTaxCalculationMethod($customer->id) == PS_TAX_EXC ? $product['product_price'] : $product['product_price_wt']; $customization_text = ''; if (isset($customized_datas[$product['product_id']][$product['product_attribute_id']])) { foreach ($customized_datas[$product['product_id']][$product['product_attribute_id']][$order->id_address_delivery] as $customization) { if (isset($customization['datas'][Product::CUSTOMIZE_TEXTFIELD])) foreach ($customization['datas'][Product::CUSTOMIZE_TEXTFIELD] as $text) $customization_text .= $text['name'].': '.$text['value'].'<br />'; if (isset($customization['datas'][Product::CUSTOMIZE_FILE])) $customization_text .= count($customization['datas'][Product::CUSTOMIZE_FILE]).' '.$this->l('image(s)').'<br />'; $customization_text .= '---<br />'; } if (method_exists('Tools', 'rtrimString')) $customization_text = Tools::rtrimString($customization_text, '---<br />'); else $customization_text = preg_replace('/---<br \/>$/', '', $customization_text); } // Start - Added DA 25/09/2018. Get product description for new poles codes. $results = Db::getInstance()->executeS('select `description_short` FROM `'._DB_PREFIX_.'product_lang` WHERE `id_product` = \''.pSQL($product['product_id']).'\' '); $desc_short = ''; if ($results) { $desc_short = $results[0]['description_short']; } // End -Added DA 25/09/2018. Get product description for new poles codes. $url = $context->link->getProductLink($product['product_id']); $items_table .= '<tr style="background-color:'.($key % 2 ? '#DDE2E6' : '#EBECEE').';"> <td style="padding:0.6em 0.4em;">'.$product['product_reference'].'</td> <td style="padding:0.6em 0.4em;"> <strong><a href="'.$url.'">'.$product['product_name'].'</a>' .(isset($product['attributes_small']) ? ' '.$product['attributes_small'] : '') .(!empty($customization_text) ? '<br />'.$customization_text : '') .'<br />'.$desc_short // Added by DA 25/09/2018 for 2018 pole code changes to output product description on order confirmation received by AMGS. .'</strong> </td> <td style="padding:0.6em 0.4em; text-align:right;">'.Tools::displayPrice($unit_price, $currency, false).'</td> <td style="padding:0.6em 0.4em; text-align:center;">'.(int)$product['product_quantity'].'</td> <td style="padding:0.6em 0.4em; text-align:right;">' .Tools::displayPrice(($unit_price * $product['product_quantity']), $currency, false) .'</td> </tr>'; } foreach ($params['order']->getCartRules() as $discount) { $items_table .= '<tr style="background-color:#EBECEE;"> <td colspan="4" style="padding:0.6em 0.4em; text-align:right;">'.$this->l('Voucher code:').' '.$discount['name'].'</td> <td style="padding:0.6em 0.4em; text-align:right;">-'.Tools::displayPrice($discount['value'], $currency, false).'</td> </tr>'; } if ($delivery->id_state) $delivery_state = new State((int)$delivery->id_state); if ($invoice->id_state) $invoice_state = new State((int)$invoice->id_state); if (Product::getTaxCalculationMethod($customer->id) == PS_TAX_EXC) $total_products = $order->getTotalProductsWithoutTaxes(); else $total_products = $order->getTotalProductsWithTaxes(); $order_state = $params['orderStatus']; // Filling-in vars for email $template_vars = array( '{firstname}' => $customer->firstname, '{lastname}' => $customer->lastname, '{email}' => $customer->email, '{delivery_block_txt}' => MailAlert::getFormatedAddress($delivery, "\n"), '{invoice_block_txt}' => MailAlert::getFormatedAddress($invoice, "\n"), '{delivery_block_html}' => MailAlert::getFormatedAddress( $delivery, '<br />', array( 'firstname' => '<span style="color:'.$configuration['PS_MAIL_COLOR'].'; font-weight:bold;">%s</span>', 'lastname' => '<span style="color:'.$configuration['PS_MAIL_COLOR'].'; font-weight:bold;">%s</span>' ) ), '{invoice_block_html}' => MailAlert::getFormatedAddress( $invoice, '<br />', array( 'firstname' => '<span style="color:'.$configuration['PS_MAIL_COLOR'].'; font-weight:bold;">%s</span>', 'lastname' => '<span style="color:'.$configuration['PS_MAIL_COLOR'].'; font-weight:bold;">%s</span>' ) ), '{delivery_company}' => $delivery->company, '{delivery_firstname}' => $delivery->firstname, '{delivery_lastname}' => $delivery->lastname, '{delivery_address1}' => $delivery->address1, '{delivery_address2}' => $delivery->address2, '{delivery_city}' => $delivery->city, '{delivery_postal_code}' => $delivery->postcode, '{delivery_country}' => $delivery->country, '{delivery_state}' => $delivery->id_state ? $delivery_state->name : '', '{delivery_phone}' => $delivery->phone ? $delivery->phone : $delivery->phone_mobile, '{delivery_other}' => $delivery->other, '{invoice_company}' => $invoice->company, '{invoice_firstname}' => $invoice->firstname, '{invoice_lastname}' => $invoice->lastname, '{invoice_address2}' => $invoice->address2, '{invoice_address1}' => $invoice->address1, '{invoice_city}' => $invoice->city, '{invoice_postal_code}' => $invoice->postcode, '{invoice_country}' => $invoice->country, '{invoice_state}' => $invoice->id_state ? $invoice_state->name : '', '{invoice_phone}' => $invoice->phone ? $invoice->phone : $invoice->phone_mobile, '{invoice_other}' => $invoice->other, '{order_name}' => $order->reference, '{order_status}' => $order_state->name, '{shop_name}' => $configuration['PS_SHOP_NAME'], '{date}' => $order_date_text, '{carrier}' => (($carrier->name == '0') ? $configuration['PS_SHOP_NAME'] : $carrier->name), '{payment}' => Tools::substr($order->payment, 0, 32), '{items}' => $items_table, '{total_paid}' => Tools::displayPrice($order->total_paid, $currency), '{total_products}' => Tools::displayPrice($total_products, $currency), '{total_discounts}' => Tools::displayPrice($order->total_discounts, $currency), '{total_shipping}' => Tools::displayPrice($order->total_shipping, $currency), '{total_tax_paid}' => Tools::displayPrice( ($order->total_products_wt - $order->total_products) + ($order->total_shipping_tax_incl - $order->total_shipping_tax_excl), $currency, false ), '{total_wrapping}' => Tools::displayPrice($order->total_wrapping, $currency), '{currency}' => $currency->sign, '{gift}' => (bool)$order->gift, '{gift_message}' => $order->gift_message, '{message}' => $message ); // Shop iso $iso = Language::getIsoById((int)Configuration::get('PS_LANG_DEFAULT')); // Send 1 email by merchant mail, because Mail::Send doesn't work with an array of recipients $merchant_mails = explode(self::__MA_MAIL_DELIMITOR__, $this->merchant_mails); foreach ($merchant_mails as $merchant_mail) { // Default language $mail_id_lang = $id_lang; $mail_iso = $iso; // Use the merchant lang if he exists as an employee $results = Db::getInstance()->executeS(' SELECT `id_lang` FROM `'._DB_PREFIX_.'employee` WHERE `email` = \''.pSQL($merchant_mail).'\' '); if ($results) { $user_iso = Language::getIsoById((int)$results[0]['id_lang']); if ($user_iso) { $mail_id_lang = (int)$results[0]['id_lang']; $mail_iso = $user_iso; } } $dir_mail = false; if (file_exists(dirname(__FILE__).'/mails/'.$mail_iso.'/new_order.txt') && file_exists(dirname(__FILE__).'/mails/'.$mail_iso.'/new_order.html')) $dir_mail = dirname(__FILE__).'/mails/'; if (file_exists(_PS_MAIL_DIR_.$mail_iso.'/new_order.txt') && file_exists(_PS_MAIL_DIR_.$mail_iso.'/new_order.html')) $dir_mail = _PS_MAIL_DIR_; if ($dir_mail) Mail::Send( $mail_id_lang, 'new_order', sprintf(Mail::l('New order : #%d - %s', $mail_id_lang), $order->id, $order->reference), $template_vars, $merchant_mail, null, $configuration['PS_SHOP_EMAIL'], $configuration['PS_SHOP_NAME'], null, null, $dir_mail, null, $id_shop ); } return parent::hookActionValidateOrder($params); } } ?>
  5. PS 1.6.0.8 Hi Is there any easy way top identify what module creates what cookie. For example: - module 1 creates cookie1, cookie2 and cookie3 - module 2 creates cookie4, cookie5 and cookie6 etc.. Is there a module or tool that would do that? Thanks for any help.
  6. Thanks for answering. The issue is that when you view the product with no image, all the images show on the product page. When you go into the module and click save, it then shows the images. Very odd.
  7. PS 1.6.1.11 Hi I've noticed this problem on other sites. The "xx Products in the same category" module sometimes does not display images. See attached for details. If I click on one of the products in this module, the images are correct on the chosen product. Question: why do the images show for some products but not others? Thanks for any help.
  8. PS 1.6.1.11 I know I don't have support on this anymore (purchased May 2017), but we are just getting around to testing the worldpay module and there is a MAJOR flaw. This flaw is apparent when using the "Old Gateway". When the payment is made on worldpay and returns the user to the PS website, the url contains "order-confirmation.php" which causes a 404 error. Don't have this issue when using the "REST API Gateway" where the url returned to contains "order-confirmation" A result of this is that the payment is made in worldpay but the order is never created. I suggest this needs to be fixed if not already done so. I would have expected any bug fixes, which is what this is, to be fixed free of charge. There is no such php script as "order-confirmation.php". Anyone else come across this issue?
  9. Hi Multitrust I know this is an old post but just in case you need some more advice, please see my thoughts below. I take it you will be using a till system in your physical shop. If you go for an online till solution, they may well also supply a web solution that links to your till via their APIs. This is one solution and may be the simplest. If you want to use Prestashop with an online till system you would have to get the till manufacturers APIs to get access to the till database and then update your website from there. In my opinion you want the "Master" database on the till, therefore all feeds to the website, Ebay, Amazon etc., are synchronized from the till and you only need to update the till. I have carried out this solution recently for one of our partners, and once I had the the till system APIs I created several bespoke processes to : - update the website products from till - automated scheduled process - update the website stock from the till - automated scheduled process - update the till with website orders including stock adjustments - automated scheduled process This is not a simple solution but does free you from having to input web orders onto the till for instance. If I were you, my first step would be to decide what till system you are using and ask the manufacturers if they also supply a web based solution that links to the till. My tuppence worth. Cheers
  10. Hi Ollie In your products import file, you must set the value of "Delete existing images (0 = No, 1 = Yes)" to one of these values. Setting this to "1" will delete all product images for the product before importing the new ones. Hope this helps. Cheers
  11. PS 1.6.1.11 Hi Problem with displaying of the wrong image when selecting a colour attribute. The Grey jacket does not come in size XXL but when I select it the correct message is shown telling me it's not available and the "add to cart" button is not displayed which is also correct, but the large grey image should be shown and not the large blue image. Has anyone come across this issue and is it fixable? See screenshot to see what I mean.
  12. PS 1.6.1.11 Hi I would like to import a CSV file with specific prices for each product combination so that it will show like the attached screenshots which show the original price scored out, the new price and the discount amount. Unfortunately the only way to do this is to add each discount price for each combination manually. There does not seem to be a way to import via CSV. Anyone have a solution? Thanks for any help.
×
×
  • Create New...