Jump to content

jpmad4it

Members
  • Posts

    10
  • Joined

  • Last visited

Profile Information

  • Activity
    Web development agency

Recent Profile Visitors

1,988,131 profile views

jpmad4it's Achievements

Newbie

Newbie (1/14)

1

Reputation

  1. Hi again, I have got the related product price displaying correctly, but how can I change this so that it shows the price with TAX / VAT? Any help would be amazing. Thanks in advance. EDIT: Oh I figured it out. Changed: $other_value['displayed_price'] = Product::getPriceStatic($other_value['id_product'],false); to $other_value['displayed_price'] = Product::getPriceStatic($other_value['id_product'],true);
  2. In case anyone wants to know how to do this.......... Hi I got this working by doing the following in v1.5.3.1: In /classes/Category.php find this code: public function getSubCategories($id_lang, $active = true) { if (!Validate::isBool($active)) die(Tools::displayError()); $groups = FrontController::getCurrentCustomerGroups(); $sql_groups = (count($groups) ? 'IN ('.implode(',', $groups).')' : '= 1'); $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS(' SELECT c.*, cl.id_lang, cl.name, cl.description, cl.link_rewrite, cl.meta_title, cl.meta_keywords, cl.meta_description FROM `'._DB_PREFIX_.'category` c '.Shop::addSqlAssociation('category', 'c').' LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON (c.`id_category` = cl.`id_category` AND `id_lang` = '.(int)$id_lang.Shop::addSqlRestrictionOnLang('cl').') LEFT JOIN `'._DB_PREFIX_.'category_group` cg ON (cg.`id_category` = c.`id_category`) WHERE `id_parent` = '.(int)$this->id.' '.($active ? 'AND `active` = 1' : '').' AND cg.`id_group` '.$sql_groups.' GROUP BY c.`id_category` ORDER BY `level_depth` ASC, category_shop.`position` ASC '); foreach ($result as &$row) { $row['id_image'] = file_exists(_PS_CAT_IMG_DIR_.$row['id_category'].'.jpg') ? (int)$row['id_category'] : Language::getIsoById($id_lang).'-default'; $row['legend'] = 'no picture'; } return $result; } and change it to this: public function getSubCategories($id_lang, $active = true) { if (!Validate::isBool($active)) die(Tools::displayError()); $groups = FrontController::getCurrentCustomerGroups(); $sql_groups = (count($groups) ? 'IN ('.implode(',', $groups).')' : '= 1'); $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS(' SELECT c.*, cl.id_lang, cl.name, cl.description, cl.link_rewrite, cl.meta_title, cl.meta_keywords, cl.meta_description FROM `'._DB_PREFIX_.'category` c '.Shop::addSqlAssociation('category', 'c').' LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON (c.`id_category` = cl.`id_category` AND `id_lang` = '.(int)$id_lang.Shop::addSqlRestrictionOnLang('cl').') LEFT JOIN `'._DB_PREFIX_.'category_group` cg ON (cg.`id_category` = c.`id_category`) WHERE `id_parent` = '.(int)$this->id.' '.($active ? 'AND `active` = 1' : '').' AND cg.`id_group` '.$sql_groups.' GROUP BY c.`id_category` ORDER BY `level_depth` ASC, category_shop.`position` ASC '); foreach ($result as &$row) { $row['id_image'] = file_exists(_PS_CAT_IMG_DIR_.$row['id_category'].'.jpg') ? (int)$row['id_category'] : Language::getIsoById($id_lang).'-default'; $row['legend'] = 'no picture'; $categ = new Category((int)$row['id_category'], (int)$id_lang); $row['nbproducts'] =$categ->getProducts(NULL, NULL, NULL, NULL, NULL, true); } return $result; } Basically you've added this code: $categ = new Category((int)$row['id_category'], (int)$id_lang); $row['nbproducts'] =$categ->getProducts(NULL, NULL, NULL, NULL, NULL, true); Then in /themes/your_theme/category.tpl use the following code inside your foreach loop {foreach from=$subcategories item=subcategory} to get the number of products: {$subcategory.nbproducts} Worked a treat for me!!! EDIT: PS I found this here: http://www.prestashop.com/forums/topic/154373-product-count-on-subcatergories/
  3. Hi I got this working by doing the following in v1.5.3.1: In /classes/Category.php find this code: public function getSubCategories($id_lang, $active = true) { if (!Validate::isBool($active)) die(Tools::displayError()); $groups = FrontController::getCurrentCustomerGroups(); $sql_groups = (count($groups) ? 'IN ('.implode(',', $groups).')' : '= 1'); $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS(' SELECT c.*, cl.id_lang, cl.name, cl.description, cl.link_rewrite, cl.meta_title, cl.meta_keywords, cl.meta_description FROM `'._DB_PREFIX_.'category` c '.Shop::addSqlAssociation('category', 'c').' LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON (c.`id_category` = cl.`id_category` AND `id_lang` = '.(int)$id_lang.Shop::addSqlRestrictionOnLang('cl').') LEFT JOIN `'._DB_PREFIX_.'category_group` cg ON (cg.`id_category` = c.`id_category`) WHERE `id_parent` = '.(int)$this->id.' '.($active ? 'AND `active` = 1' : '').' AND cg.`id_group` '.$sql_groups.' GROUP BY c.`id_category` ORDER BY `level_depth` ASC, category_shop.`position` ASC '); foreach ($result as &$row) { $row['id_image'] = file_exists(_PS_CAT_IMG_DIR_.$row['id_category'].'.jpg') ? (int)$row['id_category'] : Language::getIsoById($id_lang).'-default'; $row['legend'] = 'no picture'; } return $result; } and change it to this: public function getSubCategories($id_lang, $active = true) { if (!Validate::isBool($active)) die(Tools::displayError()); $groups = FrontController::getCurrentCustomerGroups(); $sql_groups = (count($groups) ? 'IN ('.implode(',', $groups).')' : '= 1'); $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS(' SELECT c.*, cl.id_lang, cl.name, cl.description, cl.link_rewrite, cl.meta_title, cl.meta_keywords, cl.meta_description FROM `'._DB_PREFIX_.'category` c '.Shop::addSqlAssociation('category', 'c').' LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON (c.`id_category` = cl.`id_category` AND `id_lang` = '.(int)$id_lang.Shop::addSqlRestrictionOnLang('cl').') LEFT JOIN `'._DB_PREFIX_.'category_group` cg ON (cg.`id_category` = c.`id_category`) WHERE `id_parent` = '.(int)$this->id.' '.($active ? 'AND `active` = 1' : '').' AND cg.`id_group` '.$sql_groups.' GROUP BY c.`id_category` ORDER BY `level_depth` ASC, category_shop.`position` ASC '); foreach ($result as &$row) { $row['id_image'] = file_exists(_PS_CAT_IMG_DIR_.$row['id_category'].'.jpg') ? (int)$row['id_category'] : Language::getIsoById($id_lang).'-default'; $row['legend'] = 'no picture'; $categ = new Category((int)$row['id_category'], (int)$id_lang); $row['nbproducts'] =$categ->getProducts(NULL, NULL, NULL, NULL, NULL, true); } return $result; } Basically you've added this code: $categ = new Category((int)$row['id_category'], (int)$id_lang); $row['nbproducts'] =$categ->getProducts(NULL, NULL, NULL, NULL, NULL, true); Then in /themes/your_theme/category.tpl use the following code inside your foreach loop {foreach from=$subcategories item=subcategory} to get the number of products: {$subcategory.nbproducts} Worked a treat for me!!! EDIT: PS I found this here: http://www.prestashop.com/forums/topic/154373-product-count-on-subcatergories/
  4. Hi - did anyone get this working? The above solution didn't work for me as the subcateory count needs to be passed through to category.tpl and it doesn't seem to be related to category-tree-branch.tpl. I think it might require editing the /controllers/front/CategoryController.php file as the $subcategories variable seems to be set there. I'm not sure though. Any help would be much appreciated.
  5. This is now fixed, They released a new version of the module on their website. How do I mark this as SOLVED?
  6. Does anyone have any ideas, or links to where this has been solved please?
  7. Hi all, I am using Prestashop version 1.5.3.1. I have been searching and implementing code from topics on here to try and show the number of products in my sub-categories but I just cannot get it working. There are a number of topics on here that I have followed, but the one that has got me closest to displaying anything relevant is when I added this line of code to /themes/default/category.tpl: <h3><a href="{$link->getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'htmlall':'UTF-8'}" class="cat_name">{$subcategory.name|escape:'htmlall':'UTF-8'}</a> [{l s='%d products' sprintf=$subcategory}] This line of code outputs the ID of the subcategory but not the number of products e.g. 34 products. I am assuming that a function needs editing in one of the PHP files so that I can pass through the number of products in each subcategory, but I do not know how to do this. I have tried editing the code in the /modules/blockcategories/blockcategories.php files as suggested in a lot of topics, but I can't get it working. I don't even know if the file I am editing is passing through the information that I need to category.tpl ? I have seen this topic here: http://www.prestashop.com/forums/topic/190264-solved-show-number-of-products-next-to-categories/ but I think this applies to the category_tree_branch.tpl file. I require the number of products in the subcategories to be displayed in the cateogry.tpl file. Please can someone help me fix this? It is driving me slightly insane. Any help will be MUCH appreciated. Kind regards Jp
  8. Hi, yes I've contacted Payment Sense. it is their own Prestashop module that they have developed so hopefully they should fix it.
  9. Hi all, I am using the paymentsense module (http://developers.pa....uk/prestashop/) with Presashop 1.5.3.1. Everything is working fine and the payments are taken, but the problem occurs when the Paymentsense form is meant to redirect the user back to my store. Nothing happens. I just see the message that the payment has been authorised and the system gets stuck on this page. Here is the error that paymentsense have emailed to me: Hello, You are receiving this email as an error occurred whilst processing a payment using our hosted payment form solution. We were unable to successfully deliver the transaction result to your system. This could have been caused by a network problem (e.g. a connection timeout), or an error occurring on your ServerResultURL page. Please see the end of this email for more details about this error. As this error happened after the transaction was processed, we suppressed it from the customer, and displayed the transaction result to them on our system. Here is the result of this transaction: StatusCode: 0 Message: AuthCode: ****** CrossReference: ****** OrderID: 20130306-161015~18 Amount : **** GBP We recommend that you log into the MMS (https://mms.paymentsensegateway.com) and verify the result against our record of the transaction in the transaction history page. Thank You, PaymentSense ------------------------------------------------------- Additional detailed information relating to this error: ERROR 13326: Couldn't speak to ServerResultURL [http:/www.mydomain.com/shop/modules/ps_paymentsense/callback.php]. Full Error Details: The remote server returned an error: (500) Internal Server Error. Vary: Host,Accept-Encoding X-UA-Compatible: IE=Edge,chrome=1 X-FRAME-OPTIONS: SAMEORIGIN Connection: close Content-Length: 0 Cache-Control: no-transform Content-Type: text/html; charset=utf-8 Date: Wed, 06 Mar 2013 16:11:39 GMT Expires: Wed, 06 Mar 2013 16:11:39 GMT Server: Apache/2.2.23 (Unix) mod_ssl/2.2.23 OpenSSL/0.9.8e-fips-rhel5 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 X-Powered-By: PHP/5.3.19 So it looks like there is a problem with the ServerResultURL . If I go directly to the page http:/www.mydomain.com/shop/modules/ps_paymentsense/callback.php on my site I get the message StatusCode=30&Message=Hashes did not match -so at least the page is there and it is working as it states the SHA-1 Hash isn't correct. If anyone could help me to pinpoint why this is happening I would be very grateful. I'm pretty competent at PHP and smarty, so if anyone has come across this before and knows which files need editing please let me know. At first I thought it might be something to do with permissions, or maybe something in the config files. Kind regards Jp
×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More