noesac Posted December 4, 2010 Share Posted December 4, 2010 I would like to make the product reference number in my email confirmation link the product on the website. Any tips on how I can do this? Link to comment Share on other sites More sharing options...
rocky Posted December 4, 2010 Share Posted December 4, 2010 Change line 81 of classes/PaymentModule.php from: global $cart; and line 241 from '.$product['reference'].' to: <a href="'.$link->getProductLink($product['id_product'], $product['link_rewrite'], $product['id_category_default']).'">.$product['reference'].' I haven't tested this code, but it should point you in the right direction. Link to comment Share on other sites More sharing options...
noesac Posted December 4, 2010 Author Share Posted December 4, 2010 Hi Rocky, global $cart; is only in product.php and discount.php, do you mean one of those? Link to comment Share on other sites More sharing options...
rocky Posted December 4, 2010 Share Posted December 4, 2010 No, I mean classes/PaymentModules.php. That line should be at the top of the validateOrder function in PrestaShop v1.3.2. You must add $link to the list of global variables, otherwise you can't get the link to the product. Link to comment Share on other sites More sharing options...
leelee23 Posted January 5, 2011 Share Posted January 5, 2011 Sorry to hijack this - but as classes/PaymentModules.php has the configuration for the customer order form - in terms of the mailalerts that goes to the specified email addresses, which class is the coding for the email in?Thanks,Lee Link to comment Share on other sites More sharing options...
rocky Posted January 5, 2011 Share Posted January 5, 2011 It's classes/Mail.php that contains the Send function that creates the email, then passes it to Swift to send. Link to comment Share on other sites More sharing options...
leelee23 Posted January 6, 2011 Share Posted January 6, 2011 Thanks rocky - useful, but can't find exactly what I want in there! Basically the admin email I recieve to notify me of an order - I want to change the column of 'Ref' to be the 'Product Code'. Where abouts is this coded?I've looked in /mailalerts/mails/en/new_order.html but the bit I want to edit comes up as {items}Any ideas?Cheers,Lee Link to comment Share on other sites More sharing options...
rocky Posted January 7, 2011 Share Posted January 7, 2011 That code is on lines 106-119 of modules/mailalerts/mailalerts.php (in PrestaShop v1.3.2): $itemsTable = ''; foreach ($params['cart']->getProducts() AS $key => $product) { $unit_price = Product::getPriceStatic($product['id_product'], (bool)(Product::getTaxCalculationMethod() == PS_TAX_INC), $product['id_product_attribute'], 2, NULL, false, true, $product['cart_quantity']); $price = Product::getPriceStatic($product['id_product'], (bool)(Product::getTaxCalculationMethod() == PS_TAX_INC), $product['id_product_attribute'], 6, NULL, false, true, $product['cart_quantity']); $itemsTable .= ' '.$product['reference'].' '.$product['name'].(isset($product['attributes_small']) ? ' '.$product['attributes_small'] : '').' '.Tools::displayPrice($unit_price, $currency, false, false).' '.intval($product['cart_quantity']).' '.Tools::displayPrice(($price * $product['cart_quantity']), $currency, false, false).' '; } Link to comment Share on other sites More sharing options...
leelee23 Posted January 7, 2011 Share Posted January 7, 2011 OK thanks rocky, that did the trick. The only other bit I need to alter this in is on the PDF - where once again I want to swap 'reference' for 'id_product'but the only line within classes/PDF.php is the below (which doesn't solve it: $this->Cell($w[1], $lineSize, ($product['product_reference'] != '' ? $product['product_reference'] : '---'), 'B'); Any ideas? Link to comment Share on other sites More sharing options...
rocky Posted January 7, 2011 Share Posted January 7, 2011 There are actually a few different lines with the product reference that you will need to change. If you want to replace all references with product IDs, just change all $product['product_reference'] to $product['product_id'] Link to comment Share on other sites More sharing options...
leelee23 Posted January 7, 2011 Share Posted January 7, 2011 Cheers dude - that solved the problem! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now