Hello!

Tell me what to do, how to solve the issue of adding goods to the basket at the link:

http://kaychyk-s.ru/index.php/my-cart.html?option=com_virtuemart&view=productdetails&virtuemart_product_id=283&virtuemart_category_id=40 

The following table comes out. How to make it normal?

 { "products": [{ "product_page": "?option=com_virtuemart&view=productdetails&virtuemart_product_id=283&virtuemart_category_id=40", "product_id": 283, "product_name": "Eko fanki lami", "description": "", "price": 3125.3, "quantity": 2, "product_full_image": "images\/stories\/virtuemart\/product\/3573.jpg", "product_thumb_image": "http:\/\/kaychyk-s.ru\/cache\/mod_ajax_dockcart\/6b717fbf310066948635f6efbdfffedd.png" }], "sum": "3687,85 \u0440\u0443\u0431", "succ": 1, "message": "" } 

    1 answer 1

    I wonder where does this "table come out"? In general, this is a string in json format. And to convert it to an object or an array, there is a function json_decode

    See an example here.

    • Just convert and replace it, I understood correctly? - spectr
    • @spectr, convert to an array, and what to do next with this array is what you should already know. I did not take place as a telepath)) PS And yet, where did he get out? )) - Deonis
    • when adding a product to the cart) - spectr
    • Thank you, I will understand .. - spectr
    • @Deonis, go to the link and click on the button "add to cart". There will be a POST form on index.php, which instead of meaningful HTML produces the array. So the answer to the question "what to do" is not so obvious :-) - user6550