Hot answers tagged

2

Fixed query select p.ID as order_id, p.post_date, i.order_item_name, max( CASE WHEN im.meta_key = '_product_id' and i.order_item_id = im.order_item_id THEN im.meta_value END ) as Prod_ID from wp_posts as p, wp_postmeta as pm, wp_woocommerce_order_items as i, wp_woocommerce_order_itemmeta ...


2

Many thanks to Nathan Powell for the fix. Changing get_stylesheet_directory() to get_stylesheet_directory_uri() will return the correct URL. get_stylesheet_directory() returns the absolute server path to child or parent theme (hence my previous issue) whereas get_stylesheet_directory_uri() returns the properly formed URI of child or parent theme. I ...


2

The code you have provided is incomplete. Not sure if that is the only code you are using to achieve what you want. So, besides first code block which you have provided, bellow I am adding all rest of the code which is required to show the new field on backend in 'Order Details' box and make it editable through custom fields. Please note, in your second code ...


2

I had already changed the config and options file to have the correct site root, logins, etc Did you change all URLs in the database, or just the two site address options in wp_options? If there are old MAMP URLs in the database, this could be the issue. See WordPress Serialized PHP Search Replace Tool to correctly change URLs in the database. Don't ...


2

To begin with you may need to add %s to the sprintf function, as the current link has no anchor text and this is supposed to be put in by sprintf as the second argument: return sprintf( '<div class="form-block block-after-indent"><a class="atbtn atbtn--secondary1" href="#sime_url_product_id_%d">%s</a></div>', $product->id, ...


1

Unfortunately there is no hook available to remove that "Our Bank Details" text. But, you can hide the default which is added and un-intended area by placing following rule in your theme's style.css file: .woocommerce-order-received .woocommerce h2:nth-of-type(2) { display: none; } Then to have "Our Bank Details" at intended place, simply go to ...


1

WooCommerce 2.5 is on its way. That introduces a filter for $note_classes which was missing in previous version. Once that ships, you can use following code which adds css classes to order note containers. Then you can use those classes to apply colors. You need to put this in your functions.php file. function woo_process_order_note_classes($note_classes, ...


1

It is all fine. You just need to declare variable global first then you can set the value of this and access globally. function my_free_shipping( $is_available ) { global $woocommerce, $product_notfree_ship; // set the product ids that are $product_notfree_ship $product_notfree_ship = array( '1', '2', '3', '4', '5' ); Then again declare it globally when ...



Only top voted, non community-wiki answers of a minimum length are eligible