Integrate "$aData[iProduct]" variable

filoaman

Avatar: filoaman

2011-08-29 11:57

Hello friend.

I wonder if this is possible....

I know that there is this variable "$aData[iProduct]" i also know what is all about.
I try to Integrate this variable to product pages.

For an application i need to transfer the value of this variable using a simple form.
I use this line of code in my form on product (full) description:

<input type="hidden" name="VarName" value="$aData[iProduct]" />

but it doesn't work i get the rest values from my form but not the value of this variable ($aData[iProduct]).

Any ideas ???

» Quick.Cart v4.x

boboo

Avatar: boboo

2011-08-29 13:08

You want to show this Product Number in the full description, or?
I 'm afraid, I did not understand corectly. Please more clearly...

it-service.kimla.de

filoaman

Avatar: filoaman

2011-08-29 13:14

I want to send the "Product Number" from a simple html from on full description body to an external script for an application i want to implement.

I can do it manual using this type of code :
<input type="hidden" name="VarName" value="XX" />
Where "XX" is the Product Number, but i like to do it using the '$aData[iProduct]" variable in order to avoid manually editing every product full description.

I hope this second message make the case more clear.

boboo

Avatar: boboo

2011-08-29 13:39

The problem is:
the '$' character declares a variable - OK.
but it is used in the database as field_split_character.
If you put this into the description, you will get one field more in the data set and resulting mismatch.
If you will use the &#36; as dollar sign, you will see the text "$aData[iProduct]" and not the value of variable.
Use the <input ...> line outside of full description in the products_default.tpl

it-service.kimla.de

filoaman

Avatar: filoaman

2011-08-29 14:37

boboo thank you for your answer
I'm not sure that i get it 100%

Finally is it possible to receive from a form inside the body of full description the value of "$aData[iProduct]" variable or not?

I try to put the code line
<input type="hidden" name="VarName" value="$aData[iProduct]" />
as you suggest on the appropriate template file (.tpl) but i don't get any value after send the data using the for. I also can't see anything different on the product page.
I also try:
<input type="hidden" name="VarName" value="&#36;aData[iProduct]" />
without succes, i receive all the values of the form but not the value of the "$aData[iProduct]" variable, i just get the name of the variable as value ($aData[iProduct]).

Did i miss something?
Please hepl.

boboo

Avatar: boboo

2011-08-29 14:47

i just put the $aData[iProduct] somewhere in the products_default.tpl (exactly: behint the currency symbol) and i see the number of product there.
you want to send it to another script? use the GET method.

it-service.kimla.de

filoaman

Avatar: filoaman

2011-08-29 15:34

thank you for your answer.
unfortunately i'm unable to solve my problem.

I now put the "$aData[iProduct]" on the appropriate (.tpl) and i can see the value.
But i can't send this value to the other script.
I try every trick i know and i spend sometime searching around the net for a solution but i just can't do it.

I use:
$_GET['iProduct'];
$_GET['aData[iProduct]'];
$_GET['$aData[iProduct]'];
$_GET['&#36;aData[iProduct]'];
but nothing works...

All the other values i need (from the form) pass to the next script,
But i can't see how can i "get" a value outside the form (since i put the "$aData[iProduct]" on template is now outside the form.

Any ideas ???

boboo

Avatar: boboo

2011-08-29 15:51

How do you call this another script?

it-service.kimla.de

Makaron

Avatar: Makaron

2011-08-29 15:52

Hm.. if You have form You should make hidden input which contains this variable fe:

<input name="iProduct" type="hidden" value="$aData[iProduct]" />


After that You can use this variable after sending form like this: $_GET['iProduct']

I helped? Like it: www.facebook.com/makwebpl

filoaman

Avatar: filoaman

2011-08-29 15:59

Actually this was the first trick i tray, but you mention that it is not possible to put this code INSIDE the full description body of the product.
If i put this line of code INSIDE the full description body (where my form is) i get as value the "$aData[iProduct]" string and not the real value.

I also try put this code on template (.tpl) but doesn't work i get nothing

I'm really stuck here...

Makaron

Avatar: Makaron

2011-08-30 09:34

So put whole form in template file (.tpl) which is connected with this one specific page (read about creating templates in documentation).

I helped? Like it: www.facebook.com/makwebpl

filoaman

Avatar: filoaman

2011-08-30 18:55

@Makaron
Thank you for the answer.
i actually had the same thought yesterday, and i try to implement it but i was tired and my mind wasn't clear enough to do it. further more i had no idea where to start.
Now i will follow your suggestion and i will read the appropriate documentation.
I hope finally to implement what i have in my mind!

filoaman

Avatar: filoaman

2011-08-31 09:18

I make big progress i finally figure out for to code my form and pass all the data and valuer i want to my script.
The only problem i have now is that i must change to .css
Is it possible to use two different .css files one (default) for all the other products and another (e.g.: "myCSS") only for the products i like to use the form i make ?
Where i hate to start ?
Is there any documentation ?

cgan

Avatar: cgan

2011-08-31 10:12

Yes - one way is to import "myCSS.css" into default.css and use elements named specific for your form. See default.css on line 4 how plugin.css is imported.

cgan

Back to top
about us | contact