[resolved] Write out categorie name on order page. Possible ? (6 posts)

  1. Szalk
    Posted 3 years ago #

    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!


  2. ollybach
    Plugin Author

    Posted 3 years ago #

    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 .....

  3. Szalk
    Posted 2 years ago #

    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!

  4. ollybach
    Plugin Author

    Posted 2 years ago #

    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

  5. ollybach
    Plugin Author

    Posted 2 years ago #

    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)

  6. ollybach
    Plugin Author

    Posted 2 years ago #

    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...

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WPPizza
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.