Support » Plugin: WPPizza » Write out categorie name on order page. Possible ?

  • Resolved Szalk


    I want to write out the name of the ithemes category on the order page. (and, if possible, in e-mail)
    Is there any easy way?

    For example here:


    <?php foreach($cart['items'] as $item){ ?>
    <li><u><?php echo''.$item['count'].' X </u> '.$item['name'].' <b><small>[ '.$item['size'].'  ]</small></b>' ?> <span><?php echo''.$cart['currency'].' '.$item['pricetotal'].''; ?></span> [CATEGORIE NAME]</li>
    				<?php if(is_array($item['additionalinfo']) && count($item['additionalinfo'])>0){foreach($item['additionalinfo'] as $additionalInfo){?>
    					<span><?php echo $additionalInfo ?></span>
    				<?php }} ?>
    			<?php } ?>

    [Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum’s parser.]

    Thank you very much!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author ollybach


    short answer: not easily/really . no.

    long answer: you could change:

    <?php foreach($cart['items'] as $item){ ?>


    <?php foreach($cart['items'] as $itemKey => $item){
    /*now $expl[0] contains the post id
    and you could to something like getting the permalink for this id and do something with it*/
    etc etc

    however: if you have the same item in more than 1 category it will only ever display the same category, no matter which category the item was under when you added it to the cart.

    that’s a wordpress thing and has nothing to do with me …..



    I tried, but failed.
    All food is included in one category only.
    I want to do it that name, size and category of the food is send me by email.
    I changed the code, but how do I specify that a class type that?

    Thanks for your help!

    Plugin Author ollybach


    it does’t do that at the moment.
    however, there will be an update available to the plugin in a couple of days or so (v.2.5) which has some filters added you will be able to use.

    when it’s released I will post a code example here

    Plugin Author ollybach


    sorry will take a few more days

    (i’ve integrated it in the next update to make it quite easy to do, but as quite a few more things have been added i need to make sure i dont break things)

    Plugin Author ollybach


    2.5+ will also now return the category(ies) of any given item.
    just edit your templates accordingly

    for example in wppizza-order-email-html.php
    in the foreach loop

    foreach($order_items as $k=>$v){ etc...

    $v[‘categories’] would also return the categories and their slugs etc
    you can probably take it from there…

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Write out categorie name on order page. Possible ?’ is closed to new replies.