Follow by Email

Using Code Tag To Generate WooCommerce Products

It is a fact that WooCommerce is of the best wordpress plugin for

online shop or any e-commerce and millions of wordpress user have

installed it for use.



Should in case there is willingness to generate with the use of html

code or tag, that should not be a problem. According to the article on

websitedesignwebsitedevelopment.com, such aim can be achieved by using

the code below:-



function get_products_and_packages

(){

$args = array(

'post_type' => 'product',

'posts_per_page' => -1,

'product_tag' => array

('package')

);

$packages = get_posts($args);

$currency =

get_woocommerce_currency_symbol();

$arr = array();

if(!empty($packages)):

foreach($packages as $package):

$meta = get_post_meta($package-

>ID);

$arr[$package->ID]['name'] =

$package->post_name;

$arr[$package->ID]['title'] =

$package->post_title;

$arr[$package->ID]['price'] =

current($meta['_regular_price']);

$arr[$package->ID]['display_price']

= $currency.$arr[$package->ID]

['price'];

endforeach;

endif;

return $arr;

}

1 comment:

Blogger said...

eToro is the ultimate forex broker for beginning and advanced traders.

ARTICLES YOU MUST READ

Hottest Downloads of the Year!

    Best Java, Android Games, Apps
    ·        
    ·         History Of Airtel In Nigeria
    ·         New Airtel Receive Free Call

    INTERESTING FREE EBOOKS:-

    100 Ways To Kill Your Business

    One Thousand Ways To Make Money

    Make Extra Money Flipping Houses While On Vacation

    Secrets Of Successful Writers

    Write Good Or Die By Scott Nicholson

    Less Than Words Can Say by Richard Mitchell

    Handbook of Applied Cryptography

    Coding Projects In Python

    INTERESTING LINK SHRINKING NETWORKS:-

    Adsen.us>>>, Link4.me>>>, Oke.io>>>, bitly.com>>>, goo.gl>>>, Adhy.pe>>>, Shorte.st>>>, Linkshrink.net>>>, Xp.to>>>, Adfoc.us>>>, Adfly.com>>>, Mgcash.com>>>, Is.gd>>>, Tiny.cc>>>, Bc.vc>>>, Fee.io>>>, Cpvlink.net>>>, Linkcash.com>>>, Cpmlink.com>>>>, Admy.link>>>, Cashfly.com>>>, Al.ly>>>, Blv.me>>>