News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Incorrect Hyperlinks in Cart

Started by NickM52, June 21, 2016, 13:41:39 PM

Previous topic - Next topic

NickM52

When my products are displayed in the cart they have a a thumbnail picture and then their description, which is a hyperlink to the product detail page.
How is this hyperlink text is generated? The reason I ask is that some of my products have an incorrect hyperlink. I think the link should be to the product slug with "-detail" appended to it.

However, for some of my products the hyperlink references a non-existent itemid (121). For instance the hyperlink might read;

<a href="/index.php/component/virtuemart/cus-524-detail?Itemid=121">Custom Picture Frame</a>

there is no such Itemid in my product database. If the user clicks on this hyperlink the whole cart refreshes and then the hyperlink is correct. It now displays

<a href="/index.php/component/virtuemart/cus-524-detail">Custom Picture Frame</a>\

If the user clicks on the link again then they are taken to the detail page. Obviously this means the user has to click the link twice and wait for the cart to refresh before they can see the detail.
I'm thinking this must trace back to an error in my data. If anyone can tell how the link is created, I can go and check my data.

I'm using Joomla 3.5.1 and Virtuemart 3.0.14

Thanks.

GJC Web Design

121 must exist somewhere...  check hidden, trashed etc menu items leading to the cart
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

NickM52

I'm still having this problem and I've checked everything I can think of.  Is there anyone on this forum who is involved with the coding of the cart that can tell me how these links are created?
Thanks.

GJC Web Design

hmm .. checked a few of my sites.. that link never has an itemid on mine

you can do a dirty filthy hack and go in templates\your_template\html\com_virtuemart\cart\default_pricelist.php ~ line 44


<?php $link1 = JHtml::link ($prow->url, $prow->product_name);

      $link = str_replace('?Itemid=121','',$link1);
//or if it varies remove everything after ?
//$link = preg_replace("/(.*?)\?(.*)/", "$1", $link1);//remove after ?

echo $link;

?>

;)
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

NickM52

That's awesome - thanks John!
Nick

Milbo

Nick, I would like to solve the problem, the "fix" of GJC is not useable for the core and to prevent it in future.

So to check if there is a trashed cart item is a good idea. Maybe a trashed item, which is published is used, then I just need to extend the router sql.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/