jeffharrell / minicart

The minicart is a great way to improve your PayPal shopping cart integration.
MIT License
501 stars 211 forks source link

How to fetch the details of items in the next page checkout.php #314

Open sammy101740 opened 4 years ago

sammy101740 commented 4 years ago

Please help me in coding. I want to fetch the details of the the cart in the next page checkout.php. How can i do that?

11JoseMarcos11 commented 4 years ago

Hello, Sammy. I have the same problem. Did you manage to solve?

sammy101740 commented 4 years ago

No my problem is not solved.

On Wed, 15 Jul, 2020, 9:52 pm José Marcos, notifications@github.com wrote:

Hello, Sammy. I have the same problem. Did you manage to solve?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/jeffharrell/minicart/issues/314#issuecomment-658861771, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIKTHAYWL2ZMJJ6HD43ZMCTR3XJS3ANCNFSM4NZFE5TA .

11JoseMarcos11 commented 4 years ago

I managed to get the names of the products this way: I am using VSCode. In the js / minicart.js file, I went to line 1912 and changed <input type = "hidden" name = "item_name _ <% = idx%>" value = "<% = items [i] .get (" item_name ")% > "/>for <input type =" hidden "name =" item_name [] "value =" <% = items [i] .get ("item_name")%> "/> and in PHP I took the values like this::

<?php
$cart = $_POST["item_name"];
for($i = 0; $i < count($cart); $i++)
{
    $name = $cart[$i];
    echo "Name ".$name.'<br>';
}
?>

See if it works for you. Sorry about my English.

ghost commented 3 years ago

just change action value inside minicart.js to your php page.. that would be solve the problem. Anyway this project is not maintained anymore. I also cannot find the documentation, so u can choose another library for your project if you can

11JoseMarcos11 commented 3 years ago

You can also try this way:

foreach ($_POST as $key => $value)
{
     echo "Field ".htmlspecialchars($key)." is ".htmlspecialchars($value)."<br>";
}