Post by Cartyhe » Thu Jul 05, 2012 8:52 am

Hi there again. I wanted to add the option to compare products to the product page and so far so good but I hit a few obstacles;
(working on local server iMac/MAMP with OC1.5.3.1 installed)

Added to /catalog/controller/product/product.php:

Code: Select all

$this->data['text_compare'] = sprintf($this->language->get('text_compare'), (isset($this->session->data['compare']) ? count($this->session->data['compare']) : 0));
$this->data['button_compare'] = $this->language->get('button_compare');
$this->data['compare'] = $this->url->link('product/compare');
Added to ../../template/product/product.tpl:

Code: Select all

<div class="product-compare"><a href="<?php echo $compare; ?>" id="compare-total"><?php echo $text_compare; ?></a></div>
I added this within the breadcrumbs DIV tag, right before the DIV_end_tag, so it would be on same level (in line with the breadcrumbs) but float on the right side (added CSS)

Now everything works OK, no parsing error, except;
  • even if there was already a product added to the comparison list (e.g. from on category page), it would only show as text_compare. however, if I refresh the product page or add this product to the comparison list, then it would correctly show the text and how many product there are in the comparison list.
  • clicking on "compare products", would get me to the comparison page, though, that is fine!
What am I doing wrong here and what should I be changing so it would show the e.g. "Compare Products (3)" from the very first time the product page loads?

Thank you!

New member

Posts

Joined
Wed Jul 04, 2012 1:21 pm

Post by Cartyhe » Tue Jul 10, 2012 12:32 pm

Anyone?
No one?
::)

New member

Posts

Joined
Wed Jul 04, 2012 1:21 pm
Who is online

Users browsing this forum: No registered users and 78 guests