egweimai Posted June 6, 2010 Posted June 6, 2010 Hello, I am running 2.2RCa with STS. I am looking for a particular bit of code... but cant seem to find it.... I am looking for the function that decides what to do when a customer clicks the buy button (add to cart button) on a product page. It obviously looks at the settings in the admin (as it can be configured to show cart or not). But I cant seem to find it..... Any ideas? Thanks
germ Posted June 6, 2010 Posted June 6, 2010 Not a function. Look in /catlog/includes/application_top.php starting here: // Shopping cart actions if (isset($HTTP_GET_VARS['action'])) { // redirect the customer to a friendly cookie-must-be-enabled page if cookies are disabled if ($session_started == false) { tep_redirect(tep_href_link(FILENAME_COOKIE_USAGE)); } if (DISPLAY_CART == 'true') { $goto = FILENAME_SHOPPING_CART; $parameters = array('action', 'cPath', 'products_id', 'pid'); } else { $goto = basename($PHP_SELF); if ($HTTP_GET_VARS['action'] == 'buy_now') { $parameters = array('action', 'pid', 'products_id'); } else { $parameters = array('action', 'pid'); } } ... (MORE CODE) ... At least a "normal" shop works this way. Not sure if STS modifies this or not.... :unsure: If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you. "Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice." - Me - "Headers already sent" - The definitive help "Cannot redeclare ..." - How to find/fix it SSL Implementation Help Like this post? "Like" it again over there >
egweimai Posted June 6, 2010 Author Posted June 6, 2010 ok thanks.... I have found this..... if (DISPLAY_CART == 'true') { $goto = FILENAME_SHOPPING_CART; $parameters = array('action', 'cPath', 'products_id', 'pid'); } else { $goto = basename($PHP_SELF); if ($HTTP_GET_VARS['action'] == 'buy_now') { $parameters = array('action', 'pid', 'products_id'); which obviously tells it what to do depending on the settings in the admin. I want to get a jquery popup when added to the cart, when display cart is false. I have set up what I want it to do... Using fancybox, to have a jquery iframe popup..... Any ideas....? I have currently thought about loading the scripts and css files through the product_info STS file, and then adding something to application_top but im not sure what, or if this method would work.....???
germ Posted June 6, 2010 Posted June 6, 2010 I did something like you want here, but I don't use STS or jquery. There is a flaw in my logic somewhere as I have noticed that there are times when the "Added to cart" message will popup when it really didn't happen. But since the original poster wasn't interested in pursuing it I never bothered to find out just what was happening. Maybe it will give you some ideas. If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you. "Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice." - Me - "Headers already sent" - The definitive help "Cannot redeclare ..." - How to find/fix it SSL Implementation Help Like this post? "Like" it again over there >
egweimai Posted June 7, 2010 Author Posted June 7, 2010 hmmm thanks for that.... I am struggling though! I have looked at that, cant really get it to work 100% under STS..... Does no one have this functionality in their store?
Recommended Posts
Archived
This topic is now archived and is closed to further replies.