V
V
VPVPVP2020-05-11 11:12:42
WooCommerce
VPVPVP, 2020-05-11 11:12:42

How is data passed to woocommerce?

The task is this. There is a site with a starry sky generator on canvas. According to the idea, after payment, a person should receive a high-resolution pdf version with the same map that he generated.
Here it is implemented on woocommerce-
https://strellas.com/kreator/?lang=en

I thought to pre-create products with the required sizes and transfer the selected data there somehow when generating a star map.
Explain how they commodify it in woocomerce? I would like to understand the logic. I realized there that this is some kind of variable product, based on the console .. but I don’t quite understand how to implement it on my site.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
W
WP Panda, 2020-05-11
@VPVPVP

The selected data is passed to the handler https://strellas.com/?action=checkoutPoster
Then, on their basis, the product is formed according to the received attributes, the product, by the way, is most likely simple, there is no need for a variable one, because there can be an infinite number of variations. The product is formed on the fly, apparently, they simply add an array with elements to the elements of the WC_Cart object and, based on them, the cost is displayed.
It is actually not very complicated, you just need to understand how the basket works and how the goods are assembled.
PS, by the way, their thing is very full of holes, but it will process, although it requires POST, but the product can be added to the cart and so
https://strellas.com/?action=checkoutPoster&json={...
You can see how it works on fingers here. The implementation is on the knee and clumsy, but the essence is clear
https://gist.github.com/WP-Panda/a16f2da4fc5f514a4...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question