Zen Follower
- Join Date:
- May 2009
- Posts:
- 105
- Plugin Contributions:
- 0
can I show model number in Recently Viewed sidebox?
Can you let me know the code for showing model number in the Recently Viewed sidebox?
Views: 1,423
Zen Follower
Can you let me know the code for showing model number in the Recently Viewed sidebox?
Oba-san
Adapt the code as shown for your other sidebox ... :smile:
Zen Follower
How to change the code in tpl_recently_viewed.php in template folder?
'<td><div class="recent-products-name"><a href="' . $link . '">' . zen_get_products_name($recent_product, $_SESSION['languages_id']) . '</a></div><div class="rent-products-price">' . zen_get_products_display_price($recent_product) . '</div></td>' . "\n" .
Thanks
Oba-san
Make sure the products_model is included in the SELECT statement then reference it in the template ...
Or, use the function to call it from the functions_lookups.php file:
/*
* Return any field from products or products_description table
* Example: zen_products_lookup('3', 'products_date_added');
*/
function zen_products_lookup($product_id, $what_field = 'products_name', $language = '') {
Zen Follower
could not get it right. Can you please give the codes?
Oba-san
Find the variable for the products_id in the sidebox ...
Then use:
zen_products_lookup($your_products_id, 'products_model')
to get the products_model of that products_id ...
So if the sidebox is using:
$recent_product
for the products_id then use:
zen_products_lookup($recent_product, 'products_model')
something like:
'<td><div class="recent-products-name"><a href="' . $link . '">' . zen_get_products_name($recent_product, $_SESSION['languages_id']) . zen_products_lookup($recent_product, 'products_model') . '</a></div><div class="rent-products-price">' . zen_get_products_display_price($recent_product) . '</div></td>' . "\n" .
Tell staff why this post should be reviewed.