Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 10-18-2004, 05:28 PM   #1
pxsmp420
I'd rather be fishin'
 
Join Date: Oct 2004
Posts: 59
Default Flash Components working with PHP MySQL in OSCommerce

I currently have a Flash Movie with lots of products. It works like a shopping site. In each of the products I have either a single "Add to Cart" button or both "Add to Cart" and a combo box that has product attributes that need to be added to the action script to transfer to the php. I have all the values and product_id from the MySQL database. I have what I think the php code is:

productinfo.php
PHP Code:
<?php echo tep_draw_hidden_field('products_id'$product_info['products_id']) . tep_image_submit('button_in_cart.gif'IMAGE_BUTTON_IN_CART); ?>
applicationtop.php
PHP Code:
// 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');
      }
    } 
I am not sure how to transfer the data of the combo box or just the "add to cart" button to the php page.

I dont necessarilly need to access the mysql database, because if there is a way to code the "add to cart" button to add product_id # whatever to the shopping cart I can hard code each product since we wont ever have more than 30-40 products. Any help would be very appreciated. I have been through countless forums to try and find an answer prior to posting w/o any luck.

Thanks in advance.

Mike

Last edited by CyanBlue; 10-19-2004 at 01:24 AM.
pxsmp420 is offline   Reply With Quote
Old 10-18-2004, 08:00 PM   #2
pxsmp420
I'd rather be fishin'
 
Join Date: Oct 2004
Posts: 59
Default

Anybody?
pxsmp420 is offline   Reply With Quote
Old 10-19-2004, 01:34 AM   #3
CyanBlue
Super Moderator
 
CyanBlue's Avatar
 
Join Date: Jan 2002
Location: Centreville, VA
Posts: 26,666
Default

Howdy...

Three hour is not enough time for normal people to understand what your problem is...

Okay... You have your Flash movie which has a product with ADD TO CART button... (Forget about the combo box for now...)
And, I see that you have your PHP file... (Is it working PHP file???)

You want to see something happening backend when you press that button, right???
What happens when you apply this type of script to the button???
PHP Code:
sendObject = new Object();
sendObject.click = function(eventObject)
{
    
trace("Hello");
    
addToCart_lv = new LoadVars();
    
addToCart_lv.id "123"// your product id
    
addToCart_lv.price "123.45";
    
addToCart_lv.quantity 1;
    
addToCart_lv.action "buy_now";
    
addToCart_lv.onLoad = function (ok)
    {
        if (
ok)
        {
            
trace("Added to the cart...");
        }
        else
        {
            
trace("Problem accessing the PHP file...");
        }
    }
    
addToCart_lv.sendAndLoad("applicationtop.php"addToCart_lv"POST");
}
this.addToCart_btn.addEventListener("click"sendObject)
this.addToCart_btn.label "Add to Cart"
__________________
CyanBlue / Jason Je / Macromedia Certified Flash Developer & Designer
http://CyanBlue.FlashVacuum.com
http://www.FlashVacuum.com
http://tutorials.FlashVacuum.com

Do NOT PM, Email or Call me... Your question belongs right in this forum...
CyanBlue is offline   Reply With Quote
Old 10-19-2004, 10:44 PM   #4
freddycodes
Master of Nothing
 
Join Date: Dec 2002
Location: San Diego, CA
Posts: 2,468
Default

Its going to be a little more difficult to incorporate a flash movie into osCommerce. I would suggest setting a external php script seprate from the core functionality of osComemrce. And have it interact with osCommerce and have the flash movie interact with it.
freddycodes is offline   Reply With Quote
Old 10-19-2004, 10:52 PM   #5
CyanBlue
Super Moderator
 
CyanBlue's Avatar
 
Join Date: Jan 2002
Location: Centreville, VA
Posts: 26,666
Default

You've got to listen to him, Mike... He knows everything... He probably knows where you are now...
__________________
CyanBlue / Jason Je / Macromedia Certified Flash Developer & Designer
http://CyanBlue.FlashVacuum.com
http://www.FlashVacuum.com
http://tutorials.FlashVacuum.com

Do NOT PM, Email or Call me... Your question belongs right in this forum...
CyanBlue is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:21 AM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.