Add product to basket from different multisite blog using woocommerce

Đã có trọn bộ đề thi thử THPT Quốc Gia 2022 các môn: vip.dethihsg247.com
QUẢNG CÁO: Đổi thẻ cào thành tiền mặt min rút 10k tại đây

I have a multisite on different domains.

site-one.com

site-two.com

I am currently using Woocommerce Multistore plugin (https://woomultistore.com/) to sync products from one site to another as they are to be exactly the same. To be honest the plugin has many faults and bugs and I want to try something custom.

My thoughts were that instead of copying the products from one site to another that I could use a hook like pre_get_posts to get the products of site-one and display them on site-two.

I have had initial success in this by this simple function that gets products from the DB associated with site-on if its a product post type:

This has its limitations as it only works frontend for now but the other hurdle I am looking to fix is that on site-two the products are showing but I cant add them to the basket. Nothing happens when I try – page just reloads.

The add to cart ajax returns this error in console:

Firstly I would like to know whether this route I’m taking will eventually work or is it impossible and based on that – if it is possible where should I go from here? Im stumped as to how to add to basket?!

Xin chào các bạn và quý Thầy Cô. Hãy nhập từ khóa mình muốn vào ô tìm kiếm trên Website để tìm kiếm mọi thứ hoặc trên google các bạn hãy nhập từ khóa + dethihsg247.com để tìm kiếm các bài viết của chúng tôi nhé.
  • Hiện tại chúng tôi có hơn 25 nghìn bài văn mẫu các thể loại.
  • Kho tài liệu, đề thi học sinh giỏi các lớp vô cùng phong phú.
  • Mỗi ngày cập nhật hơn 100 đề thi chất lượng từ các website bán tài liệu lớn.

Tải đề thi VIP với giá siêu rẻ tại Vip.Dethihsg247.Com