Customising the product page with php

  • Posts: 4
  • Thank you received: 0
13 years 11 months ago #1369

Hi there.

Not an expert, but familiar with php and experienced with Joomla.

The shopping cart looks like a fantastic product so far, but I have a question regarding customisation.

Following a series of searches on our own database the customer selects three 'fields' leading to the following php script (or a similar "submit" form) to submit the choices - which amount to a product for purchase.

The equivalent to this might be a HOLIDAY in JUNE in FRANCE - one intangible purchase made up of three criteria arrived at by a series of previous searches and decisions.

My question is - can I - and how? - create a way to add the 'product' to the shopping cart from a php script feeding the criteria to the products page?

As you might notice, the 'value' for the fields in the form are automated from the results of a previous script leading to the page.

Thanks in advance.

flask
よろしくお願いします。


example of php code hoping to 'feed' the product page
<?php

$name=$_POST;
$dom=$_POST;
$top=$_POST;


?>

<html><body><form action="****WHEREVER THE SHOPPING CART IS.php*****" method="post">
<input name="name" type="text" readonly value='<?php echo $name;?>' /> @ <input name="dom" type="text" readonly value='<?php echo $dom;?>' /> .
<input name="top" type="text" readonly value='<?php echo $top;?>' /> <input type="submit" /></form></body></html>

Please Log in or Create an account to join the conversation.

  • Posts: 82683
  • Thank you received: 13337
  • MODERATOR
13 years 11 months ago #1372

Hi,

I'm not sure I understand what you want to do. I understand that you want to add a product to the cart in your script. For that, you can redirect the page to this URL: http://your_website.com/index.php?option=com_hikashop&ctrl=product&task=updatecart&quantity=YY&checkout=1&product_id=XX where XX is the ID of the product in HikaShop and YY the quantity to add.

Please Log in or Create an account to join the conversation.

  • Posts: 4
  • Thank you received: 0
13 years 11 months ago #1375

Thanks for the reply, sorry for confusion.

In brief, I guess I want to add my own text fields to a page and am wondering how to target them at the checkout.

Just looking at the shopping cart, so far, not really familiar with it, but if we can work this out then its a shoe-in for the job on all other fronts.

Another example of this 'product' would be an email address - customer searches database for an available choice (php scripts) and then proceeds to checkout. i'd like the fields to follow them all the way through the search process and to checkout. Using the analogy earlier, the product might be a travel ticket, but the important details would be HOLIDAY JUNE FRANCE that would have folowed the customer through the selection process.

Hope that is more clear. I can try again if necessary.

Cheers.
Flask.

Please Log in or Create an account to join the conversation.

  • Posts: 4
  • Thank you received: 0
13 years 11 months ago #1377

<<< to this URL: your_website.com/index.php?option=com_hi...=1&product_id=XX where XX is the ID of the product in HikaShop and YY the quantity to add.>>>

p.s. Sorry, but the YY appears to missing from the URL posted earlier. Could you repost it please.


I do understand your point about using the URL t add product, and we might be able to work around our original idea on how this would be setup.

Thanks again.

flask.

Please Log in or Create an account to join the conversation.

  • Posts: 82683
  • Thank you received: 13337
  • MODERATOR
13 years 11 months ago #1379

If you want just to display addtional information which is not editable by the user during the checkout, you can edit the file step.php of the view checkout via the menu Display->Views. There, you can add the HTML/PHP to display them. This way they will be displayed all the way through the checkout.
However, in order for the checkout page to be displayed, you will have to add at least one product to the cart (either the user click on a button or you do it in PHP). Then you can redirect to it : index.php?option=com_hikashop&ctrl=checkout with your input fields in the form.
Also note that you could simplify the transfer of those values to where you want them by just putting them in the session... $_SESSION = 10; to store an info and echo $_SESSION; to display it on another page...Even if it's 10 pages later.

Please Log in or Create an account to join the conversation.

  • Posts: 4
  • Thank you received: 0
13 years 11 months ago #1381

Excellent, thanks very much indeed.

Appreciate the swift, and tolerant, ;-) responses.

Will give your suggestion a go and get back to the thread with some feedback sometime soon.

Best wishes.

flask.

Please Log in or Create an account to join the conversation.

  • Posts: 82683
  • Thank you received: 13337
  • MODERATOR
13 years 11 months ago #1383

The URL display is truncated by the forum. Just click on it and you will get the full URL on your browser address bar.

Please Log in or Create an account to join the conversation.

Time to create page: 0.066 seconds
Powered by Kunena Forum