The Joomla! Forum ™



Forum rules


Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.



Post new topic Reply to topic  [ 9 posts ] 
Author Message
PostPosted: Tue Jun 23, 2009 10:40 am 
Joomla! Apprentice
Joomla! Apprentice

Joined: Tue Jun 23, 2009 10:27 am
Posts: 11
Hello,

I would like to build two websites, one in flash and the other with joomla and virtuemart.
I'd like to use the virtuemart tools in the flash website so that I don't have to build every thing again in actionscript.

I successfully got the virtuemart products from the joomla database in my flash website thanks to amfphp.
Is it possible to add a product to the virtuemart cart from the flash website ?

I tried to use the "ps_cart.php" from "site\administrator\components\com_virtuemart\classes" and it seems I have to load index.php first to initialised _VALID_MOS_ and _JEXEC .

I tried the following test.php :

<?php
include '../SiteName/index.php';

mysql_connect('localhost', 'root', '');
mysql_select_db('sitejoomla');

$sql = 'SELECT * FROM jos_vm_product';
$db_query = mysql_query($sql);
$db_array = mysql_fetch_array($db_query);

$psCart = new ps_cart();

$psCart->add($db_array);
?>

Obviouly it didn't work because I don't know what I should pass to the add function of ps_cart as parameter.

What is the class that uses the add method from ps_cart ?
Can I make it work ?

Thanks !

Arthur

ps : How come I get a no style web page when I run my test.php ?


Top
 Profile  
 
PostPosted: Thu Jun 25, 2009 11:49 am 
Joomla! Apprentice
Joomla! Apprentice

Joined: Tue Jun 23, 2009 10:27 am
Posts: 11
This is the error I get when I run the test.php :

Fatal error: Call to a member function process() on a non-object in H:\Web\Wamp\www\CommeUneFee\administrator\components\com_virtuemart\classes\ps_cart.php on line 97

And here is the ps_cart.php, line 89 to 97 :
/**
* adds an item to the shopping cart
* @author pablo
* @param array $d
*/
function add(&$d) {
global $sess, $VM_LANG, $cart, $vmLogger,$func;

$d = $GLOBALS['vmInputFilter']->process( $d );

Do you know what parameter should I send to the add function?
Would it work if I send the right parameter?


Top
 Profile  
 
PostPosted: Thu Jun 25, 2009 5:11 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Tue Jun 23, 2009 10:27 am
Posts: 11
Help !!!


Top
 Profile  
 
PostPosted: Mon Jun 29, 2009 5:48 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Tue Jun 23, 2009 10:27 am
Posts: 11
I don't understand how the add to cart button works ! :-\ :-\ :-\ ??? ??? ???
I don't get the addtocart_form.tpl.php, can anyone help ?

I could add the product to the cart using the adresse bar as this thread explains : http://forum.virtuemart.net/index.php?topic=46260.0 but I don't know what to put in the addresse bar. :-[

Disabling the Ajax functions doesn't make anything better !

please help !!


Top
 Profile  
 
PostPosted: Thu Jul 02, 2009 11:26 am 
Joomla! Apprentice
Joomla! Apprentice

Joined: Tue Jun 23, 2009 10:27 am
Posts: 11
up !


Top
 Profile  
 
PostPosted: Tue May 31, 2011 6:29 am 
Joomla! Fledgling
Joomla! Fledgling

Joined: Tue May 31, 2011 6:28 am
Posts: 2
Hi,
I need the same solution. Please help me.


Top
 Profile  
 
PostPosted: Tue May 31, 2011 7:12 am 
Joomla! Apprentice
Joomla! Apprentice

Joined: Tue Jun 23, 2009 10:27 am
Posts: 11
Hi,

It is a long time ago I developed this web site and I don't remember everything (I didn't do any web development since then) but I did something like this:
I used sh404SEF to make a unique and understandable URL automatically for each of my products,
then on the flash website I redirect to the product joomla webpage (with a simple URL redirection).

I did not find any other solution :-S

Good luck with your work, and if you find something better please post the solution here ;-)

Arthur


PS: I am also curious about your work, do you have something on line I can look at ?


Top
 Profile  
 
PostPosted: Tue May 31, 2011 10:48 am 
Joomla! Fledgling
Joomla! Fledgling

Joined: Tue May 31, 2011 6:28 am
Posts: 2
<form action="http://192.40.20.5/index.php" method="post" name="addtocart" id="addtocart">
<input type="hidden" name="option" value="com_virtuemart" />
<input type="hidden" name="page" value="shop.cart" />
<input type="hidden" name="Itemid" value="" />
<input type="hidden" name="func" value="cartAdd" />
<input type="hidden" name="prod_id" value="<?php echo $product_id ?>" />
<input type="hidden" name="product_id" value="" />
<input type="hidden" name="quantity" value="1" />
<input type="hidden" name="price" value="100" />
<input type="hidden" name="adjust_price[]" value="" />
<input type="hidden" name="master_product[]" value="" />

</form>


Top
 Profile  
 
PostPosted: Wed Feb 22, 2012 12:55 am 
Joomla! Apprentice
Joomla! Apprentice

Joined: Wed Mar 23, 2011 5:02 pm
Posts: 5
Check the solution at:
viewtopic.php?p=2515083 for VM2.0

and at http://forum.virtuemart.net/index.php?topic=98368.0 for VM1.1 (and maybe previous versions as well).

I just can't make it work (yet) with procuts having atributes (e.g.: size, color), but help was asked on this...

Lets keep sharing and improving

Cheers


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 



Who is online

Users browsing this forum: Dougj, recorpac and 9 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group