snooper
Forum Replies Created
-
Forum: Plugins
In reply to: [WooCommerce] One Page checkout plugin with custom checkout fieldsThanks, this is my current code, which is not working (i had changed as per a previous comment):
function order_origin( $checkout ) { woocommerce_form_field( 'order_link_origin', array( 'type' => 'text', 'default' => get_the_title() , ), $checkout->get_value( 'order_link_origin' )); } add_action('woocommerce_after_order_notes', 'order_origin' );
Forum: Plugins
In reply to: [WooCommerce] One Page checkout plugin with custom checkout fieldsThanks Caleb.
I see the label now, but still no content for the field value.How can I check whether the issue is that its not being saved, or not being displayed properly?
yes, thats fine I think.
Thanks
Forum: Plugins
In reply to: [WooCommerce] One Page checkout plugin with custom checkout fieldsright now I don’t even see the field label on the order page
What am I doing wrong?
Looks good – thanks very much.
Just to clarify:
I have the “local Pickup” shipping zone, which has no regions defined in it (ie, Everywhere), and in it – the shipping method of local pickup which has a cost of zero.
the Local pickup option should only appear for products that have the ‘local-pickup’ class, and not from any other product, no matter where the customer lives?
Forum: Plugins
In reply to: [WooCommerce] One Page checkout plugin with custom checkout fieldsUpdate:
I am not seeing the new fields in the order details.
Is there maybe something wrong with that filter code?
/** * Display field value on the order edit page */ add_action( 'woocommerce_admin_order_data_after_order_notes', 'order_origin_display_admin_order_meta', 10, 1 ); function order_origin_display_admin_order_meta($order){ echo '<p><strong>'.__('Order Origin').':</strong> ' . get_post_meta( $order->id, 'order_link_origin', true ) . '</p>'; }
Forum: Plugins
In reply to: [WooCommerce] One Page checkout plugin with custom checkout fieldsGreat – it works! Thanks!
Forum: Plugins
In reply to: [WooCommerce] One Page checkout plugin with custom checkout fieldsinteresting – thanks, will give it a go!
Thanks for the reply.
Are you looking to just have USPS/UPS ignore some products when they are in the cart? If so, that’ll take some more customization.
No, because i am still happy to offer the paid UPS/USPS options alongside the basic free pickup option.
For the same reason, i don’t want to mark the product as free shipping, because that would FORCE free shipping, right?
Also, it was my understanding that you dont have to mark the product as free shipping, but just give the free shipping, class correct? just making sure…
here is my code, (slight changes, but i can confirm i have a shipping class with a slug of “local-pickup”)
if ( ! class_exists( 'WC_Enable_Local_Pickup' ) ) : class WC_Enable_Local_Pickup { protected static $instance = null; /** * Initialize the plugin. * * @since 1.0 */ private function __construct() { // add our check add_filter( 'woocommerce_shipping_Local_Pickup_is_available', array( $this, 'patricks_enable_Local_Pickup' ), 20 ); } /** * Enable free shipping for orders with products that have the free-shipping shipping class slug * * @param bool $is_available * @return bool * @since 1.0 */ public function patricks_enable_Local_Pickup( $is_available ) { global $woocommerce; // set the shipping classes that are eligible $eligible = array( 'local-pickup' ); // get cart contents $cart_items = $woocommerce->cart->get_cart(); // loop through the items checking to make sure they all have the right class foreach ( $cart_items as $key => $item ) { if ( ! in_array( $item['data']->get_shipping_class(), $eligible ) ) { // this item doesn't have the right class. return false return false; } } // nothing out of the ordinary return the default value return $is_available; } /** * Return an instance of this class. * * @return object A single instance of this class. * @since 1.0 */ public static function get_instance() { // If the single instance hasn't been set, set it now. if ( null == self::$instance ) { self::$instance = new self; } return self::$instance; } } add_action( 'init', array( 'WC_Enable_Local_Pickup', 'get_instance' ), 0 ); endif;
Forum: Plugins
In reply to: [WooCommerce] One Page checkout plugin with custom checkout fieldsThanks Caleb
here is my code:
/*************************************************************/ function order_origin( $checkout ) { woocommerce_form_field( 'order_link_origin', array( 'type' => 'hidden', 'value' => get_the_title() , ), $checkout->get_value( 'order_link_origin' )); } add_action('woocommerce_after_order_notes', 'order_origin' ); /** * Display field value on the order edit page */ add_action( 'woocommerce_admin_order_data_after_order_notes', 'order_origin_display_admin_order_meta', 10, 1 ); function order_origin_display_admin_order_meta($order){ echo '<p><strong>'.__('Order Origin').':</strong> ' . get_post_meta( $order->id, 'order_link_origin', true ) . '</p>'; }
Forum: Plugins
In reply to: [WooCommerce] "you may also like" – changing the titleAmazing, thanks!
Forum: Plugins
In reply to: [WooCommerce] "you may also like" – changing the titleThanks so much, Caleb
That gettext code looks like exactly what I need – thanks!
Regarding the link to remove the related products section, how do I hook this into my child theme?
Forum: Plugins
In reply to: [WooCommerce] Weird redirect from category to product pageThanks lorro – great idea
Forum: Plugins
In reply to: [WooCommerce] Weird redirect from category to product pageHi Danny
Thanks very much for the reply.
Whats interesting about the Dyonon link (even though the href in the target is correct, it redirects to this odd link, which is partly “product-category” and partly “product”
I tried checking the product permalink, and i tried resetting the permalink settings, and then emptying the cache too – but i didnt see any change.
There should be many products in the Dyonon category, so there should not be any redirects based on a default or single product.
Thanks again – if you think of anything, let me know!
Forum: Plugins
In reply to: [WooCommerce] I have no flat rate/free shipping methodsGot it- thanks!
I there a way to have it only show for certain shipping classes?