Basically the simplified work with products' attributes is recommended for mass use - namely it is advised not to work with them at all :) as it is quite difficult. In this case when the customer submits the order to the shopping cart he gets to the system form of attribute selection for this product. If you don't like the layout of the page containing this form it can be decorated by the following methods:
1) First, don't forget to define headers and footers for the shops as well as the tables of style for the shopping-card on the whole. They are applied here. Using this method and having spent not much time you can obtain more than suitable layout of this page in the style of your own shop.
2) In your admin area you have the possibility to create any templates to enter the information on the product. That is you can create any template, appropriate the [code] code to it as well as use it where required and where you want indicating its code in the query line. For example:
Before that you should create a template with templateCode code that you want to see on this page. Don't forget to specify minimum one <%FORM%> "pseudotag" in this template for products with attributes which is automatically changed for the selection form of these attributes.
Moreover, the system contains the reserved template code using which you will receive the sole attribute selection form. This code - FORM.
Attention: In order not to specify template codes everywhere in the query you can define the default template for any of your shops in your admin area.
If you don't want to have this interim options selection page at all you should pay attention to the possibility of product information export directly to your page. Above in the table at the beginning of the page you can find url for product export in HTML format (division of word in the link occurs only "due to" the link lenght. There are neither any spaces nor page breaks there):
So you can export the necessary product information to your page right on the fly (but don't get too involved. Don't make 10 exports for every element on one page, such as price, name and so on. Otherwise a stop must be put to this business sooner or later :)). Ideally you should make it not more often than one time a page - thas is more than enough to get all the actual information (cause instead of the HTML template you will be able to create any structure convenient to you which you will be able to easily parse on receipt).
On PHP the product export to your page can be done like this:
The same is about the order. The template code may be either not used (then the system code will be taken on default) or the special code created for your own purposes can be used.
Attention: For hostings that don't have PHP and no server languages at all (even SSI) there is a single and unique :) possibility to export product information (and first of all we are certainly interested in the options' selection form) using Java-script. For that you should place the following code into your HTML page:
As you can see the request parameters are the same that those of the product.php
There is no possibility to significantly change the layout of the options' selection form. Except the standard one using the styles available on your page (for the person who is good at styles there opens really wide range of possibilities here). If you don't want to use these possibilities you always have the possibility to parse the obtained code and do everything you want with it.
You can get the code here, for example:
And finally, you receive the maximum range of possibilities to manage the layout if you are not so lazy to create this options' selection form for the products yourself with attributes you desire (IMHO, with all the above described possibilities you should be the very brave person and have the great aim to bring yourself to it). The information on the attributes and their properties for every product is contained in the XML-file (see its description above). The form should be made according to the following rules:
1. The Action form should be the same:
2. The method of data transmission should be specified as POST (method=POST)
3. In the hidden fields of the form you can specify such parameters as at a common product purchase, namely:
shop - your shop ID (obligatory)
4. Directly options are transmitted according to the following rules:
product - product ID (obligatory)
return_url - return URL to continue purchase
new_name - redefined product name
add_to_cart - submit 1 if you don't want to show the shopping-card after the product is added to the shopping cart
quantity - quantity (can also be specified in the visible margin if the user has the right to choose)
attributes_by_code - flag (=1), indicate that you use a new format for indication product's options (required from Dec 20, 2008). In this case in the option's names and values, specified below, you need use attrCode and optCode instead attrID and optID
Element name in the form representing the attribute option should be:
attr[attrID] - for attributes of type 0 and 1 (obligatory and optional choice).
attr[attrID][optID] - for attributes of type 2 (multiple choice)
At that the following values should be transmitted:
optID - for attributes of type 0 and 1 (obligatory and optional choice).
1 - for attributes of type 2 (multiple choice)
Also there should be elements to answer the questions if the choice of any option presupposes additional question. They are supposed to be called:
quest[attrID][optID] - for any option type
the submission value - the user answer.
|Contact Us Legal and Policies Sitemap||© XMLShop.com 2004 – 2021|