I worked on this today, but I couldn't succeed completely. When I click on a link like the following, it takes me to the cart page but does not add the product to the cart. I'm not sure where I'm making a mistake. Can you help me solve this problem?
http://www.site.com/purchase.php?id=2
My code
<?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();