How can i show products as radio button directly on woocommerce checkout?
I want to achieve functionality like this.-
https://i.stack.imgur.com/5mkoX.png
How can I add the product directly on the woocommerce checkout page with some options as radio buttons?
You can check this page to understand it better. https://q-grips.com/product-uk/checkout.php
do you know?
how many words do you know
See also questions close to this topic
-
How to upload a video using ACF in WordPress?
I am still at learning phase in WordPress. I cannot figure out in ACF which field type should I choose to upload a video file and which code should I write to show it at the front-end. Please look into the below code. I am using the_field('') but it isn't working. Can anyone help
<video width="954" height="535" controls class="tm-mb-40"> <source src="video/wheat-field.mp4" type="video/mp4"> Your browser does not support the video tag. </video>
-
Can you add apps made from (js, nodejs, express and mongodb) in a wordpress website?
I already have a wordpress website. I studied web development using js, node.js, express and mongodb and build some projects. I would like to add it to my website. Is this possible or I just need to create a website without wordpress and add my projects?
-
Query to get Woo products in a parent-children order
I want to build a MySQL query for a Woo database schema to get simple/variable products, but in a specific order: I want to get them in an
ID
ASC
ending order, but when a variable product is met, I want to get the variations exactly below their parent.So for a simple product, or the parent of a variable product, the
post_type
field is set to 'product' and thepost_parent
field is set to 0. For the children of a variable product (a.k.a variations) thepost_type
field is set to 'variable_product' and thepost_parent
field is set to theID
of the parent product.So, imagine this desired order:
ID post_title post_type post_parent 1100 title1 product 0 1104 title2 product 0 1130 title2 - variation1 variable_product 1104 1200 title2 - variation2 variable_product 1104 1208 title2 - variation3 variable_product 1104 1107 title3 product 0 1111 title4 product 0 1205 title4 - variation1 variable_product 1111 1210 title4 - variation4 variable_product 1111 1430 title4 - variation3 variable_product 1111 1432 title4 - variation2 variable_product 1111 So by the above table you see that I want products to be sorted by their ID, until the variation(s) of a product are met, which I want to be placed under their parent, and get sorted themselves by their ID also. So I don't care about titles not being sorted alphabetically (title4-variation4 is sorted above title4 - variation3 because the variations' IDs are sorted in an ascending order).
So I tried to play a little with
ORDER BY ID ASC, post_parent ASC
and alsoORDER BY ID ASC, post_type ASC
because product is sorted alphabetically above variation_product, but I couldn't get them sorted correctly. I always end up with parent products being sorted higher than variations, just because their IDs are smaller.SELECT * FROM wp6c_posts WHERE post_type IN ('product', 'product_variation') ORDER BY ID ASC, post_parent ASC;
Obviously I have to query table wp6c_posts twice, once for the simple/parent products, and then for the variations of the variable products, but I can't think of the correct query.
Can someone help me with this?
-
Delivery options in Woocommerce Checkout not registering country & postal correct
I am currently working on a Woocommerce site, where I need to setup shipping with a flat rate to Denmark - and no shipping to other countries.
When I input correct date into input field postal code + city, woocommerce returns with an error, that the inputted data doesnt have a shipping method:
'Customer matched zone "Locations not covered by your other zones"'
The problem is, that it shoudl actually be matched, since I have setup flat rate correctly for Denmark.
In my functions.php I have tried the following:
add_filter( 'default_checkout_billing_country', 'change_default_checkout_country' ); add_filter( 'default_checkout_billing_state', 'change_default_checkout_state' ); function change_default_checkout_country() { return 'DK'; // country code } function change_default_checkout_state() { return ''; // state code }
But this doesn't seem to do the trick.
- I don't have any weight and dimensions since every thing gets delivered by my own courier.
- My shipping is flat rate and is added correct.
Does anyone know what could be the problem, since I should have set everything up as mentioned in documentation, yet it can't match the customer info to my shipping method.
EDIT #1
I now figured out, that the system doesn't set any delivery country - so maybe that is why.
I am using ARG Multi-Step Checkout, which could also cause the problem.
-
How to export image links in different columns in WooCommerce?
I want to export the image links of my products in different columns. For example like IMG1 IMG2 IMG3.
So i wrote this code below (Not Worked):
foreach( $articles as $key => $article ) { if ( array_key_exists( 'ID', $article ) ) { $i = 1; $product = wc_get_product( $article['ID'] ); if ( ! empty( $product ) ) { $featured_img = wp_get_attachment_url( $product->get_image_id() ); if ( ! empty( $featured_img ) ) { $articles[ $key ]['Image ' . $i] = $featured_img; } $other_imgs = $product->get_gallery_image_ids(); if ( ! empty( $other_imgs ) ) { foreach ( $other_imgs as $id ) { $i++; $img = wp_get_attachment_url( $id ); $articles[ $key ]['Image ' . $i] = $img;
UPDATE
Code returns null