Linux 软件免费装
Banner图

Commodity

开发者 mwtsn
更新时间 2014年10月24日 20:30
PHP版本: 3.3 及以上
WordPress版本: 4.0
版权: GPLv2 or later
版权网址: 版权信息

标签

cart custom post type shopping products discounts sale discount basket for sale uk pounds vat

下载

2.0.2 2.1.0 2.0.1 2.0.3 2.0.4 2.0.5 2.1.1 2.1.2

详情介绍:

Created by Make Do, this plugin gives you a custom post type, and a range of meta boxes for the rendering products (including product and global discount codes). You can turn off as much as you like, and use the meta boxes on your own post types. Together you can use these to build your own shopping cart, price list, menu, discount system, etc. Commodity features View the FAQ section for usage instructions. If you are using this plugin in your project we would love to hear about it.

安装:

  1. Backup your WordPress install
  2. Upload the plugin folder to the /wp-content/plugins/ directory
  3. Activate the plugin through the 'Plugins' menu in WordPress

屏幕截图:

  • The products custom post type, with the values and discounts meta boxes enabled
  • The options screen

升级注意事项:

There have been no breaking changes so far.

常见问题:

If I want to grab the products in my loop, what is the default custom post type name?

It is: 'commodity_products'

I've noticed that the products Custom Post Type has a category area, if I want to filter by this what is the taxonomy name?

It is also called: 'commodity_category'

What are the names of all the meta information for the 'Product values' meta box?

Those are:

  • '_commodity_price'
  • '_commodity_discount'
  • '_commodity_discount_percent'
  • '_commodity_quantity'
  • '_commodity_shipping'
  • '_commodity_shipping_total'
  • '_commodity_shipping_vat_rate'
  • '_commodity_total'
  • '_commodity_vat_rate'
  • '_commodity_vat'

What are the names of all the meta information for the 'Discounts' meta box?

So that they can be found quicker by queries, the discounts use the discount code that you set as part of the meta key. You can access them like so:

  • 'commodity_discount_code[discount code]'
  • 'commodity_discount_name[discount code]'
  • 'commodity_discount_type[discount code]'
  • 'commodity_discount_discount[discount code]'
  • 'commodity_discount_expires[discount code]'

What are the names of all the meta information for the 'Global Discounts'?

These work exactly the same as the 'Discounts' meta box, apart from you can get them using get_option().

What functions can I use?

You can use:

  • commodity_query_arguements()
The query accepts arguments.

What does the commodity_query_arguements() function do?

This function provides arguments for you to filter the products (or your own post types) creating a custom Loop. You can use it like so: get_posts( commodity_query_arguements( $args ) ); It accepts the following arguments as an array (or you can leave the $args empty to use the defaults): $defaults = array( 'featured' => false, // [ true | false ] - Set to true to return posts that have the featured post custom meta data set to true 'featured_post_meta_key' => '_commodity_featured', // The custom meta field that identifies the featured post, will also accept an array 'order' => 'ASC', // [ ASC | DESC ] 'orderby' => 'date', // [ date | menu_order | title ] 'posts_per_page' => 5, // Set number of posts to return, -1 will return all 'post_type' => 'commodity_products', // [ post | page | custom post type | array() ] 'taxonomy_filter' => false, // [ true | false ] - Set to true to filter by taxonomy 'taxonomy_key' => 'commodity_category', // The key of the taxonomy we wish to filter by 'taxonomy_terms' => 'volunteer', // The terms (uses slug), will accept a string or array 'use_featured_image' => false // [ true | false ] - Set to true to only use posts with a featured image ); get_posts( commodity_query_arguements( $defaults ) );

Can I contribute?

Sure thing, the GitHub repository is right here: https://github.com/mwtsn/commodity

更新日志:

2.1.2 2.1.1 2.1.0 2.0.5 2.0.4 2.0.2 2.0.2 2.0.1