WordPress.org

Ready to get started?Download WordPress

Forums

Cart66 Lite :: WordPress Ecommerce
[resolved] Shortcode as Template Tag (2 posts)

  1. ameraz
    Member
    Posted 1 year ago #

    WP 3.5.2
    Cart66 1.5.1

    I would like to incorporate some shortcodes to my template like so:

    $wholesale = get_post_meta($post->ID, 'item_mayoreo', true);
    $item = get_post_meta($post->ID, 'item', true);
    
    echo do_shortcode('[hide_from level="Wholesale"]');
    	echo do_shortcode('[add_to_cart item="'.$item.'"]');
    echo do_shortcode('[/hide_from]');
    
    echo do_shortcode('[show_to level="Wholesale"]');
    	echo do_shortcode('[add_to_cart item="'.$wholesale.'"]');
    echo do_shortcode('[/show_to]');

    this doesn't work!! ... obviuosly ...

    I bought a license some years ago so now I don't have access to the premium support... It would be nice to find someone with the same kind of problem...

    I couldn't find any reference documents of Cart66 Template Tags or something like so...

    http://wordpress.org/plugins/cart66-lite/

  2. ameraz
    Member
    Posted 1 year ago #

    damn!! i hate when this happens... some minutes later!!!

    it should be like this:

    $wholesale = get_post_meta($post->ID, 'item_mayoreo', true);
    $item = get_post_meta($post->ID, 'item', true);
    
    echo do_shortcode('[hide_from level="Wholesale"]'.'[add_to_cart item="'.$item.'"]'.'[/hide_from]');
    echo do_shortcode('[show_to level="Wholesale"]'.'[add_to_cart item="'.$wholesale.'"]'.'[/show_to]');

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic