random product at main page

ojp3d08

Avatar: ojp3d08

2008-07-08 21:40

Hello, I am trying to use this plugin only at main page where normally the content goes... to do this I created other page template called pages_main.tpl and I changed at admin page the view default to this page. But I didn't get the result that I wanted. How may I do this? Thanks,

» Quick.Cart v3.x

Pedro Augusto

Makaron

Avatar: Makaron

2008-07-09 09:41

Hello, You should make a different theme to main page. The whole instruction of plugin is correct but in this step:

step 3edit file "templates/themes/default.php" and after code:
  
$content .= $oTpl->tbHtml'messages.tpl''ERROR' );

paste:
$sRandomProduct $oProduct->throwRandomProduct();


You should make an another file in folder templates/themes/, You can call it main.php and it should have whole content of default.php plus this line which step 3 telling to add (in default.php this line doesn't exist).
After this in panel admin You choose theme "main.php" to Your main page. Should work :)

muljukina

No avatar

2008-08-27 23:48

Hi ojp3d08, As well as I wish to you displey function RandomProduct on the main page in content, but unfortunately plagin it works for me only in a file container.tpl in the template created by me does not work, as does not work and if to put in pages_default.tpl. Whether it has turned out to cope at you with this problem? Recommendation Makaron does not help me: (

Makaron

Avatar: Makaron

2008-08-28 10:35

Ok I tested now this solution and it needs small modification.. Line:

$sRandomProduct $oProduct->throwRandomProduct();

should be in file actions_client/p.php after line:

if( isset( $iContent ) && is_numeric$iContent ) ){

and in file core/products.php in function which You created when You installed plugin RandomProduct You should modify the parameter of this function from:

function throwRandomProduct$sFile 'container.tpl' ){


to:

function throwRandomProduct$sFile 'pages_default.tpl' ){


Block RANDOM_PRODUCT also shoulf be in file templates/pages_default.tpl.
After this changes You can put variable $sRandomProduct in somewhere in file pages_default.tpl and everything should works..

muljukina

No avatar

2008-08-28 13:30

Makaron, Many thanks, very much to you it is grateful, now all works perfectly and smoothly. It is good that there are such professionals as you ready to help. Huge many thanks!!

beholder

Avatar: beholder

2008-08-29 14:53

Hi, Muljukina, this is also for everyone expressing their thanks to OpenSolution:
if you like them, then buy some more products from them when you have a little money, your thanks is going to be twice as worth then. Best Regards.

muljukina

No avatar

2008-08-30 12:26

Hi, beholder! What can offer and for what cost? send to me on mail ehidna@newmail.ru, I will consider variants:)

beholder

Avatar: beholder

2008-08-30 18:57

I am sorry, you probably misunderstood what I wrote. I told you to buy the Exended or Pro version of QuickCart, if you really want to thank the authors of this great shopping cart. You can find more info on the opensolution website:
http://opensolution.org/

macieij

No avatar

2008-09-02 21:58

Przypadkowy produkt ładnie się wyświetla, ale zauważyłem, że po dodaniu
$sRandomProduct = $oProduct->throwRandomProduct();
w pliku p.php znika mi numerowanie stron poprzez [break]. Jak wytnę $sRandomProduct = $oProduct->throwRandomProduct(); z pliku p.php to mam numerację ale nie mam przypadkowego produktu.

Makaron

Avatar: Makaron

2008-09-03 09:05

W takim razie przenieść linię

$sRandomProduct $oProduct->throwRandomProduct();


Pod linię:

$sSubpagesList null;


w tym samym pliku..

macieij

No avatar

2008-09-04 15:18

Dzięki Makaron. Potrafisz rozwiązać każdy problem! Pozdrowienia!

muljukina

No avatar

2008-09-12 14:03

beholder,
Unfortunately, now, to me not нужены the big possibilities if the shop expands without problems I will buy the full version:)

muljukina

No avatar

2008-09-12 14:22

Makaron,

I try to correct a little a code a plug-in, namely so it is necessary for me that on the main page was more than one rundom product I am primitive, have inserted:

edit file "templates/themes/default.php" and after code:
$content .= $oTpl->tbHtml( 'messages.tpl', 'ERROR' );

paste:
$sRandomProduct0 = $oProduct->throwRandomProduct();
$sRandomProduct1 = $oProduct->throwRandomProduct();
$sRandomProduct2 = $oProduct->throwRandomProduct();
.............

Edit in file actions_client/p.php after line:
$sRandomProduct0 = $oProduct->throwRandomProduct('');
$sRandomProduct1 = $oProduct->throwRandomProduct('');
$sRandomProduct2 = $oProduct->throwRandomProduct('');
.............

Edit in file products.php,

I create the file which will contain, all chosen rundom product,
1. afte line: $iProduct = $aRandom [rand (0, $iCount - 1)];

Paste: $NoRepeat [] = $iProduct;

2. Whether further in the beginning checks the element after a line has come: foreach ($oFile-> aImagesDefault [2] as $iProduct) {I insert check with my file, whether element has been chosen before:

if (isset ($this-> aProducts [$iProduct]) && ($iProduct! = $NoRepeat)) Unfortunately check does not work well all right:)))))))))))

It is a pity that does not work, but yes we will search all right for other ways of the decision:)

clawzeeb

No avatar

2008-10-30 15:34

Is there a way to make this plugin showing 3 random products from the same category as the main product displayed in templates/product_default.tpl? Thank you.

Back to top
about us | contact