Author Topic: A "Customers who bought this product also bought" hack for Virtuemart.  (Read 30910 times)

webgobe

  • Advanced
  • Full Member
  • *****
  • Posts: 535
  • Follow me on Twitter! http://twitter.com/webgobe
    • Internet craftsman carrying on the heritage of European manufacturing traditions through original Web designs.
Re: A "Customers who bought this product also bought" hack for Virtuemart.
« Reply #15 on: February 01, 2007, 18:56:31 pm »
Did you have an upgrade to the recent versions? I  tryed it on 1.0.7, and something is fishy.... don't get anything outputted...
I would use the hack, it's fits better my site's style.
Like a fine wine... Good from the start and getting better over time.
Donations are welcome!

rightminddesigns

  • Jr. Member
  • **
  • Posts: 117
Re: A "Customers who bought this product also boug
« Reply #16 on: March 28, 2007, 15:42:18 pm »
Where can I download the latest version of this mod?

Thanks!

brek

  • Beginner
  • *
  • Posts: 37
Re: A "Customers who bought this product also bought" hack for Virtuemart.
« Reply #17 on: April 15, 2009, 11:28:06 am »
when it will be on 1.1.2 version?

silentBob

  • Beginner
  • *
  • Posts: 20
Re: A "Customers who bought this product also bought" hack for Virtuemart.
« Reply #18 on: February 18, 2010, 18:00:22 pm »
this is such a usefull mod! any chance for a new version?
aint think so..  :-\

Forrest

  • Full Member
  • ***
  • Posts: 1972
  • Me and my baby
    • Web Developer
Re: A "Customers who bought this product also bought" hack for Virtuemart.
« Reply #19 on: February 22, 2010, 23:42:07 pm »
I'll work on reviving this for VM1.1.4

ChrisL

  • Beginner
  • *
  • Posts: 28
Re: A "Customers who bought this product also bought" hack for Virtuemart.
« Reply #20 on: April 12, 2011, 21:47:49 pm »
I'll work on reviving this for VM1.1.4
any updates? :)

Forrest

  • Full Member
  • ***
  • Posts: 1972
  • Me and my baby
    • Web Developer
Re: A "Customers who bought this product also bought" hack for Virtuemart.
« Reply #21 on: April 13, 2011, 20:41:51 pm »
Well, I got it working on my site, but never released the code. My intent was to release a module, rather than hacking VM core code. That is not done.


Forrest

  • Full Member
  • ***
  • Posts: 1972
  • Me and my baby
    • Web Developer
Re: A "Customers who bought this product also bought" hack for Virtuemart.
« Reply #23 on: September 24, 2011, 06:09:24 am »
It's been a while since I looked at that code. I will have to revisit it in a few months tho, so I will give an update when I do.

Panikos

  • Beginner
  • *
  • Posts: 33
I've changed it to work on 1.1.2 if anybody is interested.

miss_mary

  • Beginner
  • *
  • Posts: 1
I've changed it to work on 1.1.2 if anybody is interested.

Hi panikos,

it would be so kind of you if you can share the code with us ...
Thanks in advance

Panikos

  • Beginner
  • *
  • Posts: 33
This works on VM 1.1.2

Attached ps_order_product_relations.php needs t go in administrator/com_virtuemart/classes

Then you need to edit administrator/com_virtuemart/html/shop.product_details.php
and insert the following code towards the bottom of the file just before where it says as a comment This has changed since VM 1.1.0
Code: [Select]
$opr = ps_order_product_relations::opr( $product_id );
Same file at the bottom after the last tpl->set
Code: [Select]
$tpl->set( "opr", $opr); // Panikos Related Products Bought
Attached related_products.tpl.php needs to go in components/com_virtuemart/themes/default/templates/common (or wherever your default VM template is).

Edit your default product flypage and add the following code wherever you want this to appear (I use components/com_virtuemart/themes/default/templates/product_details/flypage.tpl.php)
Code: [Select]
<!-- Displays Customers Also Bought -->
<tr>
  <td colspan="3"><?php echo $opr ?><br />
  </td>
</tr>

Last but not least you need to edit administrator/com_virtuemart/languages/common/english.php and add
Code: [Select]
'PHPSHOP_RELATED_PRODUCTS' => 'Customers Who Bought This Item Also Bought',
'PHPSHOP_RELATED_PRODUCTS_SUMMARY' => 'Customers Who Bought This Item Also Bought'
and any other languages you use.

[attachment cleanup by admin]