Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
OsmanK Posted October 17, 2023 Posted October 17, 2023 (edited) Hello everyone; I'm trying to obtain the IDs of products for my own pages. However, I think I need the help of more experienced friends on how to accomplish this. Thanks to everyone who helps me find a way to add a product directly to the cart in the PHP file below. When I go to this address from the browser, it goes to the cart page, but no product is added. http://www.mysite.com/card.php?id=2 <a href="http://www.mysite.com/card.php?id=2">Add to cart</a> <?php $_SERVER['SCRIPT_FILENAME'] = __FILE__; $path = ''; $_GET['app'] = 'nexus'; $_GET['module'] = 'store'; $_GET['controller'] = 'cart'; require_once $path . 'init.php'; if (\IPS\Request::i()->id) { $_SERVER['HTTP_REFERER'] = ''; $disp = \IPS\Dispatcher\External::i(); \IPS\Request::i()->csrfKey = \IPS\Session::i()->csrfKey; $disp->run(); } else { die("No ID passed"); } exit(); Edited October 17, 2023 by OsmanK
Recommended Posts