Dev & Tech Notes
San Diego | Los Angeles | Big Bear | USA
Terms & Conditions ©2005-2024 TJohns.co
Terms & Conditions ©2005-2024 TJohns.co
Articles in this Category
Top Left Text cha
Web & App Development
- Details
- Written by Timothy Johns
- Category: j2store
- Hits: 2712
I found the code for the simple view is located in a file called view_ldesc.php. And it does not work. Because they're trying to echo something that they didn't load first. Here's a snippet from it:
<div class="product-ldesc">
<?php echo $this->product->product_long_desc; ?>
</div>
But the long description works on the product browse pages. Here's the snippet in that one that actually works. I included the short description in this snippet so you can see how lazy these guys that coded it are. They used the same class for the long description ('product-short-description')...
<?php if($this->params->get('list_show_short_desc', 1)): ?>
<div class="product-short-description"><?php echo $this->product->product_short_desc; ?></div>
<?php endif; ?>
<?php if($this->params->get('list_show_long_desc', 0)): ?>
<div class="product-short-description"><?php echo $this->product->product_long_desc; ?></div>
<?php endif; ?>
Actually, that's not the issue. But, why not just leave it so people can see how careless the coding is.
Here's the next issue I found. As you can see below, they load the short description and try to echo the long description from it...
Anyway, replace the garbage code with the code below an it will display both the short description (part before 'read more') and also the long description...<?php echo $this->loadTemplate('sdesc'); ?>
<div class="product-desc">
<?php echo $this->product->product_long_desc; ?>
</div>
Oh, and if you used their product display module and had to use the other fix I mentioned, don't forget to also fix this in the core component files because the layout overrides also don't work correctly for links coming from the module.<?php echo $this->loadTemplate('sdesc'); ?>
<?php echo $this->loadTemplate('ldesc'); ?>
<div class="product-desc">
<?php echo $this->product->product_short_desc; ?>
<?php echo $this->product->product_long_desc; ?>
</div>
Comment (0)
Hits: 2712
- Details
- Written by Timothy Johns
- Category: j2store
- Hits: 3021
To fix the link in the title, go to the modules template folder and find the following line in default.php:
href="<?php echo JRoute::_( $product->module_display_link ); ?>"
Change that to:
href="/index.php?option=com_j2store&view=products&task=view&id=<?php echo $product->j2store_product_id; ?>" rel="nofollow"
Then, to fix the image link, do a similar thing in the file, default_images.php as follows... find this code:
<a href="/<?php echo $product->product_link; ?>" title="<?php echo $product->product_name; ?>">
And change it to:
<a href="/index.php?option=com_j2store&view=products&task=view&id=<?php echo $product->j2store_product_id; ?>" rel="nofollow">
Yea, what a pain... broken module now fixed. It's important that you have the extra attribute (rel="nofollow"). Otherwise it can effect your Google index because they will index the SEF URL and also the non-SEF URL without that.
NOTE:
Unfortunately, when the system follows these new links that now work, it won't use template overrides. So, any edits you did in overrides inside your template will be ignored and you'll have to overrite the component core files.
Honestly, I recommend not using this module and hard-coding the items and links. It's just a total piece of junk (not just the module, but the whole component).
Comment (0)
Hits: 3021
- Details
- Written by Timothy Johns
- Category: j2store
- Hits: 2563
Comment (0)
Hits: 2563