ericbakuladavis
Forum Replies Created
-
Forum: Plugins
In reply to: [WooCommerce] Category order by SKU shortcode?Hi JapeNZ,
I found a solution! I put this in my functions.php
add_filter('woocommerce_shortcode_products_query', 'add_sku_to_shortocde_orderby_options', 10, 2); function add_sku_to_shortocde_orderby_options ($args, $atts) { if ($atts['orderby'] == "sku") { $args['orderby'] = 'meta_value'; $args['order'] = $order == 'DESC' ? 'DESC' : 'ASC'; $args['meta_key'] = '_sku'; } return $args; return $atts; }
I tested it with a shortcode like this:
[product_category category="my-category" orderby="sku"]
…and it worked.
Thanks to you for providing everything inside the if statement. I’m not sure, but it looks like it could be adaptable to any
meta_key
.Forum: Plugins
In reply to: [WooCommerce] Category order by SKU shortcode?JapeNZ,
I’d like to do the same but this didn’t work for me. Is the idea here to override the core file? Did you include all the other functions in class-wc-query.php along with your custom function?Anyone who knows,
Is there a way to do what JapeNZ did using a filter instead?Forum: Plugins
In reply to: [WooCommerce] Download from different serverWorked for me. I just pasted in the whole URL into the File URL field.
Forum: Plugins
In reply to: [WooCommerce] Sorting products in admin and front- new products appear lastOn my admin Products page, I have one page of products, so I don’t know if this will work for you. To sort by date created, I click the word Date (with the little triangle next to it). To reverse the order, I click Date again.
What happens when you do this?
Forum: Plugins
In reply to: [WooCommerce] shipping optionsYou could so this:
Go to Admin Panel > WooCommerce > Settings > Shipping > Flat Rate
Enable it and add United States to Specific Countries. For Cost per order, enter your US shipping rate. Save changes.
Go to International Delivery and enable it. For Availability, choose Excluding Countries. For Countries, choose United States. For Cost, enter 0. Save changes.
Then put this into your functions.php:
add_filter( 'woocommerce_cart_shipping_method_full_label', 'remove_local_pickup_free_label', 10, 2 ); function remove_local_pickup_free_label($full_label, $method){ $full_label = str_replace("(Free)","(invoice will be sent)",$full_label); return $full_label; }
Replace “(invoice will be sent)” with whatever message you want.
When the user chooses United States on the checkout page, Shipping will show the rate you have chosen. When the user chooses any other country, Shipping will show “International Delivery (invoice will be sent)”, or something else depending on your custom message.
Forum: Plugins
In reply to: [WooCommerce] View Products but automatically add to cartHi darius86,
Try disabling all plugins except for WooCommerce and try again.
Also, posting a link to your site might be helpful.
Forum: Plugins
In reply to: [WooCommerce] Doubts about short desciption and custom tabThere probably is a way to add a
via code but I don’t know how.Maybe we can figure out how to display your custom field without the short description. How are you displaying the custom field?
Forum: Plugins
In reply to: [WooCommerce] Woocommerce not removing customer info after a purchaseIt is normal for WooCommerce to save guest checkout data. It should be viewable from Admin Panel > WooCommerce > Orders
What’s not normal is that another user is seeing it in another checkout session. If you click on one of the fields (First Name, for example), and start to type something else, does your friend’s info disappear, or do you have to manually delete it?Forum: Plugins
In reply to: [WooCommerce] Download products to dropbox, google drive etc.Hey Adri,
I have some more ideas for you
First, read up on overriding template files, if you haven’t already. It’s quite simple.
Second, in my last post, I left off the ‘s’ in ’emails’ in wp-content/plugins/woocommerce/templates/emails/customer-processing-order.php
That file does generate the email the customer gets after payment, but I think it uses a different template to fill in the items the customer has ordered (including any download links): plugins/woocommerce/templates/emails/email-order-items.php
I think line 59 is responsible for outputting download links for each downloadable product. You may be able to insert the button code right under that line. I’d first try insertingecho '<div>some text</div';
on a new line right under 59.
Then upload it to your-theme/woocommerce/emails/email-order-items.php
Place a test order and see if ‘some text’ appears below the downloads links in the confirmation email. If so, you’re on the right track.For the confirmation page I think the download links are put out by plugins/woocommerce/templates/order/order-details.php line 60. Try the same technique as before, then insert your button code if it all works.
Both templates use a foreach loop to ouput the download links. When there are multiple downloadable items in the order, the loop repeats until all downloadable items have been displayed. For this reason you might want to move the
<script> ... </script>
part of each button outside of the foreach loop. I think the scripts only have to be called once in order to work which seems preferable to being called in each iteration of the loop.Forum: Plugins
In reply to: [WooCommerce] Custom sort products displayed via shortcode?Here are the instructions I tried to follow: https://docs.woothemes.com/document/woocommerce-shortcodes/#section-21
It says:
But you can also sort products by custom meta fields using the code below […]
add_filter( 'woocommerce_shortcode_products_query', 'woocommerce_shortcode_products_orderby' ); function woocommerce_shortcode_products_orderby( $args ) { $standard_array = array('menu_order','title','date','rand','id'); if( isset( $args['orderby'] ) && !in_array( $args['orderby'], $standard_array ) ) { $args['meta_key'] = $args['orderby']; $args['orderby'] = 'meta_value_num'; } return $args; }
You need to place that snippet in functions.php in your theme folder and then adjust it by editing the meta_key.
Can anyone elaborate on these instructions?
I understand:
- I must create a Custom Field name, apply it to each product, giving it a value for each one.
- How to use fucntions.php.
I don’t understand:
- Does it matter what I choose for the Custom Field name?
- Do I have to edit some part of the code they provided?
Forum: Plugins
In reply to: [WooCommerce] Woocommerce not removing customer info after a purchaseAre you saying that when you went to checkout, all the fields were already filled in with your friend’s information? If so, were you using the same computer as your friend?
Forum: Plugins
In reply to: [WooCommerce] Doubts about short desciption and custom tabHi EbichuWashu,
For your first problem, try this:
Edit the product that has the blank short description
In the Product Short Description box, click the Text tab
Type or paste in:
Click Done
Click UpdateForum: Plugins
In reply to: [WooCommerce] Cannot purchase from product page.Hi Res1,
Are you using the PMPro WooCommerce plugin? Have you asked your question in their support forum?
Your product looks like a product that has no price, no image, and no description. I’m assuming PMPro is supposed to dynamically create the product and then pass the data to WooCommerce which displays it. I guess either PMPro isn’t passing the data to WooCommerce properly, or WooCommerce failing to build the product with all the data…
Forum: Plugins
In reply to: [WooCommerce] Can't choose payment gateways – Your order section greyed outHi brogitwp,
I saw this on another topic:
Try switching to TwentyTwelve theme and see if checkout works. If not, disable all plugins except WooCommerce and try again.
Another person said they fixed their issue by deactivating all plugins, including WooCommerce, then reactivating….
Forum: Plugins
In reply to: [WooCommerce] Help with woocommerce on mobileHi etai68,
Please post a link to your shop page.