Jump to content

Christian.Isai

Members
  • Posts

    9
  • Joined

  • Last visited

Profile Information

  • Location
    Canada
  • Activity
    Web development agency

Christian.Isai's Achievements

Newbie

Newbie (1/14)

1

Reputation

2

Community Answers

  1. I already put the site online and the issue is still happening, as an update if I put the debug in a module (i tested with topmenu) it does work but will only show a limited number of variables..
  2. I set up a server with wamp and installed prestashop as I would normally do, when trying to display the debug console from smarty ( using {debug} on a template file ) It seems to break due the absolute urls: getting stuff like this INLINE : \/th>\n Smarty_Variable Object (3)<\/b> ->value<\/b> = " " ->nocache<\/b> = false<\/i> ->scope<\/b> = "file:C:\\wamp\\www\\prestashop/themes/de..."<\/td><\/tr>\n \n $ er<\/th>\n Smarty_Variable Object (3)<\/b> ->value<\/b> = false<\/i> ->nocache<\/b> = false<\/i> ->scope<\/b> = "file:C:\\wamp\\www\\prestashop/themes/de..."<\/td><\/tr>\n \n $js_dir<\/th>\n Smarty_Variable Object (3)<\/b> ->value<\/b> = "http://localhost/prestashop/themes/de..." ->nocache<\/b> = false<\/i> ->scope<\/b> = "file:C:\\wamp\\www\\prestashop/themes/de..."<\/td><\/tr>\n \n $js_files<\/th>\n Smarty_Variable Object (3)<\/b> ->value<\/b> = Array (25)<\/b> ... It seems that the backslashes are breaking the script but Im not able to escape them, I read about all the debug tpl en the smarty forums but wasnt able to find a solution. Also a friend of mine working on the same enviroment was able to replicate the issue. I happened on 1.6.0.7 and 1.6.0.8, in other version I didnt had any issue, do you know what could be making this? or a possible solution?
  3. im experiencing the same issue on my stores. I hope it get fix asap
  4. I Need to link specific categories to specific manufacturers, is there a way to do this? I'll need a dropdown on the category page where you select the manufacturers like you do on the product. I tried reading adminproductcontroller but wasnt able to really understand what is needed, can someone provide with some pointers? Thank you
  5. Hi Im trying to edit the products category to display the products from the same brand on my product page, I need it to be in one of the extra hooks we got. but so far I havent being able to neither make it appear or work. Let me show you what I have done.. First I registered in the Hook I need on install: public function install() { Configuration::updateValue('PRODUCTSCATEGORY_DISPLAY_PRICE', 0); $this->_clearCache('productscategory.tpl'); return (parent::install() && $this->registerHook('extraleft') && $this->registerHook('header') && $this->registerHook('addproduct') && $this->registerHook('updateproduct') && $this->registerHook('deleteproduct') ); } This works just fine, the module appear under the hook when I check positions. then I set the params for that hook here: public function hookextraleft($params) { $id_product = (int)$params['product']->id; $product = $params['product']; $cache_id = 'productscategory|'.$id_product.'|'.(isset($params['category']->id_category) ? (int)$params['category']->id_category : $product->id_category_default); if (!$this->isCached('productscategory.tpl', $this->getCacheId($cache_id))) { $category = false; if (isset($params['category']->id_category)) $category = $params['category']; else { if (isset($product->id_category_default) && $product->id_category_default > 1) $category = new Category((int)$product->id_category_default); } if (!Validate::isLoadedObject($category) || !$category->active) return false; // Get infos $category_products = $category->getProducts($this->context->language->id, 1, 100); /* 100 products max. */ $nb_category_products = (int)count($category_products); $middle_position = 0; // Remove current product from the list if (is_array($category_products) && count($category_products)) { foreach ($category_products as $key => $category_product) { if ($category_product['id_product'] == $id_product) { unset($category_products[$key]); break; } } $taxes = Product::getTaxCalculationMethod(); if (Configuration::get('PRODUCTSCATEGORY_DISPLAY_PRICE')) { foreach ($category_products as $key => $category_product) { if ($category_product['id_product'] != $id_product) { if ($taxes == 0 || $taxes == 2) { $category_products[$key]['displayed_price'] = Product::getPriceStatic( (int)$category_product['id_product'], true, null, 2 ); } elseif ($taxes == 1) { $category_products[$key]['displayed_price'] = Product::getPriceStatic( (int)$category_product['id_product'], false, null, 2 ); } } } } // Get positions $middle_position = (int)round($nb_category_products / 2, 0); $product_position = $this->getCurrentProduct($category_products, (int)$id_product); // Flip middle product with current product if ($product_position) { $tmp = $category_products[$middle_position - 1]; $category_products[$middle_position - 1] = $category_products[$product_position]; $category_products[$product_position] = $tmp; } // If products tab higher than 30, slice it if ($nb_category_products > 30) { $category_products = array_slice($category_products, $middle_position - 15, 30, true); $middle_position = 15; } } // Display tpl $this->smarty->assign( array( 'categoryProducts' => $category_products, 'middlePosition' => (int)$middle_position, 'ProdDisplayPrice' => Configuration::get('PRODUCTSCATEGORY_DISPLAY_PRICE') ) ); } return $this->display(__FILE__, 'productscategory.tpl', $this->getCacheId($cache_id)); } if you read carefuly you'll see its the same content from productscategory ( First I tried changin every "category" to manufacturer but it didnt work . So what I did was to place the same content as the default module to see if it was working but seems that something is wrong. Hope somebody can help me thanks
  6. I found my own solution (I kinda feel stupid now..) in the getmanufacturers function you have to ask for those columns.. SELECT m.*, ml.`description`, ml.`short_description`, ml.`laregion`,ml.`ladireccion` Thanks
  7. I've created new fields on the manufacturers ( 4 of them 2 of them are translatable) /** @var string Region */ public $laregion; /** @var string address */ public $ladireccion; /** @var string website */ public $website; /** @var string Is from quebec? */ public $quebec; the fields appear and everthing works ok, information is stored in databes in all of them without any issue. but when I want to get them in manufacturer-list both variables that have multiple languages are not accesible in product list (they do appear on each manufacturer page). but the other 2 do appear can you explain me why? $manufacturers Smarty_Variable Object (3) ->value = Array (1) 0 => Array (12) id_manufacturer => "5" name => "test test" date_add => "2014-04-16 15:20:04" date_upd => "2014-04-16 16:19:36" active => "1" website => "website.com" quebec => "0" description => "<p>test</p>" short_description => "<p>test</p>" nb_products => "0" link_rewrite => 0 image => "en-default" ->nocache = false ->scope = "file:C:\wamp\www\prestashop/themes/Ma..." Thanks for your help.
  8. I end up using this as a turn around.. <img src="{$img_cat_dir}{$product->id_category_default}-medium_default.jpg"> hope it helps somebody
  9. Hello, Im developing a site but Im stuck and I hope you can point me to the right direction, Products will have 2 or more categories, the default category will be a "price and distinction" where all products that have some kind of award will display its logo and place, What Im planning is the next thing : use the category image to display the award, and an extra field on product where we set the place and maybe some quotes, right now Im using to get the category image, the problem comes when I come from any other category to the same product, it wont display the image I want. is there a way I can get always the default category image? I know I can get the default category id with $product->id_category_default, and I know we have getProductCategoriesFull but I havent being able to get the images with those tools, can you point me to the right direction ?
×
×
  • Create New...