Jump to content

Display a random product on non-PS page


Recommended Posts

I'm trying to get PrestaShop integrated with an existing website built in Joomla.

One of the modules I've created allows you to execute PHP - and now what I need it to do is display and link to a random product.

Is there an existing solution for this that's been discussed before? Would appreciate some help on this. Thank you :)

Link to comment
Share on other sites

Yeah - I tried experimenting with a few things but i'm getting botched results.

The first thing I tried was creating a PHP file in /cart named "randomProduct.php" - and in Joomla, just run this code:

<?php
include('/path/to/cart/randomProduct.php');



Whenever I echo out some dummy text from randomProduct.php - it shows up like it should, but I haven't been able to get it to communicate with the PrestaShop.

What files do I need to include in randomProduct.php - and what query would I need to run to get a random product? I don't necessarily need to use Smarty with this, as my php file will echo out some HTML.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...