emzdesign
Forum Replies Created
-
Hi
Thanks for your help. I did look at that link earlier and have tried that way too, but it didn’t work either.
The code I used was:
<?php if (!empty($item['product'])) { // replace 'Location' with your custom field name! $field_name = 'hs_code'; $hs_code = $item['product']->get_meta($field_name,true,'edit'); if ( !empty($hs_code) ) { echo 'HS Code: '.$hs_code.''; } } ?>
Am I missing something there? I am using a custom template as well. Thanks for your help.
Forum: Plugins
In reply to: [WooCommerce] Setting up different shipping cost if spend over X amountHello again
I think I’ve managed to do it. Luckily my main shipping zone cost is £5 rather than £6, so I used the additional code for other shipping rates and managed to get it to work.
Here is my modified code (although it’s not much different from the original) ??
// Extra discount on shipping for orders of values of above 150 or 100. function tarkan_adjust_shipping_rate( $rates ) { $cart_subtotal = WC()->cart->subtotal; // Check if the subtotal is greater than value specified if ( $cart_subtotal >= 39.99 ) { // Loop through each shipping rate foreach ( $rates as $rate ) { // Store the previous cost in $cost $cost = $rate->cost; // Adjust the cost as needed // original shipping greater than 6 discount by 5 if ( $cost >= 6 ) { // discount rate by 5 $rate->cost = $cost - 5; } // Optional discount for other shipping rates if ( $cost >= 5 ) { $rate->cost = $cost - 5; } } } return $rates; } add_filter( 'woocommerce_package_rates', 'tarkan_adjust_shipping_rate', 10 );
Thanks again for your help.
Forum: Plugins
In reply to: [WooCommerce] Setting up different shipping cost if spend over X amount@tarkan thank you so much, that works really well. However, I probably should have stated in my first post that this is for a specific Shipping Zone.
My main shipping zone does have free delivery over £40, whereas I have a specific zone that I need the delivery to be £1 when someone spends over £40.
This has worked for that specific shipping zone, although it has now changed the free delivery on my main shipping zone to be £1 as well.
Really sorry, I probably should have clarified. Is it possible to modify this code to work for a specific shipping zone?
- This reply was modified 7 years ago by emzdesign.
Hi
Sorry, I’ve fixed this now.
I updated the code to this:
<?php $cate = get_queried_object(); $cateID = $cate->term_id; if (function_exists('wp_get_terms_meta')) { $MetaValue = wp_get_terms_meta($cateID, 'font-colour' ,true); } echo $MetaValue; ?>
Thought it might help someone else ??
Hi
Thanks for your help. But that is what I’ve already tried?
It doesn’t display any information. I’m not sure if the function wp_get_terms_meta exists – is that called from within the plugin or do I need to add it to my functions.php file?
Thanks.
Forum: Fixing WordPress
In reply to: 4 posts on homepage, all with different backgroundsHi
Thanks for the responses.
Basically, these 4 posts will be the very latest posts that were written on the site, so they will always change and will always be by different users, different categories etc.
Hope this helps?
Thanks ??
Forum: Fixing WordPress
In reply to: 4 posts on homepage, all with different backgroundsBasically what I meant was if I were to use custom fields I’d have to depend on the users adding their own image all the time.
I just want 4 images that are there all the time that aren’t controlled by custom fields or what category/author etc. is.
I’m not sure what you mean by adding a counter to the loop. Are there any examples of this anywhere?
Thanks.
Forum: Fixing WordPress
In reply to: 4 posts on homepage, all with different backgroundsHiya
Thanks for the response. Unfortunately they are always going to be by different users as well.
I appreciate your time though ??
Forum: Plugins
In reply to: Making category selection radio buttonsCan anyone help me? Thanks.
Forum: Fixing WordPress
In reply to: Show Authors Unpublished PostsCan anyone help with this?
Forum: Fixing WordPress
In reply to: Displaying users who are logged inThanks! Exactly what I was looking for! ??