Fork me on GitHub

pncommerce smarty error  Bottom

  • I'm trying to get the random product block for pncommerce working, but I keep getting this error:

    Code

    Warning: Smarty error: pncAddItem: missing parameter ItemID in /home/quasito/public_html/testsite/includes/classes/Smarty/Smarty.class.php on line 1083



    The block I'm using has a very simple template code:


    Code

    <!-- start itemview block -->

    <!--[ pncGetItem Random=true assign=Item ]-->

    <div style="text-align:center;">

        <!--[ $Item.Name ]--><br />
        <!--[ pnml name='_PNC_ITEMCOST' ]-->: <!--[ $Item.CostLong|pncShowAsPrice ]--><br />
        <!--[ pncAddItem ItemID=$Item.ID Long=false ]-->
       
    </div>

    -<!-- end itemview block -->


    If I remove the "pncAddItem" tag I don't get the error, but then the block doesn't work for what it's for...adding products the users cart.

    Support says it's not a pncommerce error, so I'm not sure what to do with it. I've completely removed/reinstalled PostNuke, and uploaded the newest snapshot of pncommerce without any difference.

    --
    born ok the first time
  • If no one is able to answer this - could someone point me in the right direction?

    --
    born ok the first time
  • I will have a look at the code, maybe the function that reads an item does not set the ID correctly.

    --
    "He is not dangerous, he just wants to play...."
  • Code

    <!--[ pncGetItem Random=1 assign=Item ]-->


    will do the job.

    --
    "He is not dangerous, he just wants to play...."
  • I'm really not trying to be a complainer - I just want it to work, and I don't know how to make it do that.
    I used the "Random=1" instead, and yes it does work...randomly. In other words sometimes it works, and sometimes it doesn't. I tried clearing the pnRender cache, but that doesn't seem to matter. I tried deleting the database, deleting all the files, and starting from scratch with a fresh installation and no other modules installed but what comes with PostNuke and pnCommerce.


    Here's the whole template page I'm using, is there anything wrong with it?

    Code

    <!-- start itemview block -->

    <!--[ pncGetItem Random=1 assign=Item ]-->

    <div style="text-align:center;">

    <a href="<!--[ pncItemDetailsLinkUrl ItemID=$Item.ID ]-->">
    <img src='<!--[$Item.ImageTN ]-->' border='0' alt='<!--[ $Item.Name ]-->'></a>

    <br />

    <!--[ $Item.Name ]-->

    <br />

    <!--[ pnml name='_PNC_ITEMCOST' ]-->:
    <!--[ $Item.CostLong|pncShowAsPrice ]-->

    <br />
    <br />

     <!--[ pncAddItem ItemID=$Item.ID Long=false ]-->
    </div>
    -<!-- end itemview block -->


    --
    born ok the first time
  • Would it be easier if I figured out a straight PHP script to pull random items....instead of using Smarty?

    --
    born ok the first time

This list is based on users active over the last 60 minutes.