Invision Community 4: SEO, prepare for v5 and dormant account notifications Matt November 11, 2024Nov 11
Posted April 16, 20168 yr My site currently uses 3.x and Nexus to sell themes, however instead of using the Nexus storefront to browse products, I've coded my own external php pages (not integrated with IP.Board). A visitor simply clicks the green "Download" link on my website, and the product is added to their cart in nexus. They are also redirected to their cart after clicking the link. I'm currently using this code to add a product to my 3.x Nexus cart: <a href='http://www.site.com/forums/buy_skin.php?id=10'>Purchase theme</a> The code which powers the link is: <? define( 'IPS_PUBLIC_SCRIPT', 'index.php' ); define( 'IPB_THIS_SCRIPT', 'public' ); require_once( './initdata.php' ); require_once( IPS_ROOT_PATH . 'sources/base/ipsRegistry.php' ); require_once( IPS_ROOT_PATH . 'sources/base/ipsController.php' ); $reg = ipsRegistry::instance(); $reg->init(); if ( $_GET['id'] ) { @header("Location: " . str_replace( '&', '&', ipsRegistry::$settings['base_url'] ) . 'app=nexus&module=payments§ion=store&do=add&id=' . intval( $_GET['id'] ) . '&k=' . $reg->member()->form_hash ); } else { die("No ID passed"); } exit(); I'd like to upgrade to 4.x. So my question is, how would I achieve the same result with 4.x and Commerce? I'm not sure if this is a useful starting point, but I'm using the following code with 4.x to change the theme based on an id in the URL (using a similar URL to the one I posted above). The Commerce solution may be similar to this, but my knowledge is super limited so I'm not entirely sure: <?php $_SERVER['SCRIPT_FILENAME'] = __FILE__; $path = ''; $_GET['app'] = 'core'; $_GET['module'] = 'system'; $_GET['controller'] = 'theme'; require_once $path . 'init.php'; if (\IPS\Request::i()->id) { $_SERVER['HTTP_REFERER'] = ''; $disp = \IPS\Dispatcher\Front::i(); \IPS\Request::i()->csrfKey = \IPS\Session::i()->csrfKey; $disp->run(); } else { die("No ID passed"); } exit(); Thanks in advance for any help!
April 16, 20168 yr Much like yourself I am looking for a simpler checkout process instead of add to cart, review cart, confirm cart, check out... I'd like it to go add to cart, and checkout. removing the two steps in the middle.
April 17, 20168 yr Author @Marcher Technologies was helpful enough to code the theme changer - not sure if you know the solution to this one too?
Archived
This topic is now archived and is closed to further replies.