Zen Cart Logo
Forums / Setting Up Categories, Products, Attributes / Text Editor CKEditor turns 'Button' option into add to cart????

Text Editor CKEditor turns 'Button' option into add to cart????

Locked

Views: 1,166

Results 1 to 5 of 5
This thread is locked. New replies are disabled.
6 Nov 2011, 10:44 PM
#1
spiggles87 avatar

spiggles87

New Zenner

Join Date:
Mar 2011
Posts:
53
Plugin Contributions:
0

Text Editor CKEditor turns 'Button' option into add to cart????

Hi,

I have a basic code using a form and button format.

<form action="**<http://www.EXAMPLE.com>**/" method="get" target="_blank"> <p> <input name="key" type="hidden" value="**KEY GOES HERE**" /><input name="product" type="hidden" value="**PRODUCT CODE GOES HERE**" /></p> <p> <font face="Arial" size="2">**Forename:**<br /> <input name="forename" /><br /> <br /> **Surname:**<br /> <input name="surname" /><br /> <br /> Number:<br /> <input name="number" /><br /> <br /> <input name="preview" type="submit" value="**PREVIEW**" /></font></p> </form>

This basically generates two text fields and a 'PREVIEW' button.

When I use this code in my product descriptions, everything is fab, until you click the PREVIEW button and it takes you to the shopping cart? Once clicked the PREVIEW button is 'supposed' to apply a new window which generates a preview image of the customers personalisation.

I can get the whole thing to work on the home page, ezpages, define pages 2 3 4 etc.... but not the product pages, which is where I need this to be and it works fantastic.

Is there any way to sort the button option to only generate the URL that is specified in the code rather than jumping to the shopping cart?

Many thanks in advance.

6 Nov 2011, 11:09 PM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Text Editor CKEditor turns 'Button' option into add to cart????

This has nothing to do with CKEditor, or any editor, for that matter. It's what you're doing that's wrong.

On a product page, the product description sits inside an existing <form>. So, since forms cannot be nested, the submit button you're adding actually submits the first form on the page.

I'm not sure how what you're doing makes sense, but I'm sure you've got your reasons. If you need to insert your own forms to completely kill the normal functionality of the Zen Cart Shopping Cart, re-arrange the HTML in your custom template to either push your product description elsewhere on the page, or remove the proper default form entirely. If you're going to do that, it sounds like you really ought to be using a completely different product type. Seems a bit pointless to be inserting forms into product descriptions.

6 Nov 2011, 11:41 PM
#3
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: Text Editor CKEditor turns 'Button' option into add to cart????

As with DrByte, I too fail to see the logic of what you are trying to do, but it seems as if it might have something to do with capturing bits of data from the customer, relative to the product they are viewing.

Have you looked at using ATTRIBUTES - particularly text input attributes?

7 Nov 2011, 9:27 AM
#4
spiggles87 avatar

spiggles87

New Zenner

Join Date:
Mar 2011
Posts:
53
Plugin Contributions:
0

Re: Text Editor CKEditor turns 'Button' option into add to cart????

Hi,

I already use text attributes to collect the customers personalisation on their orders.

What I am trying to do is create a form on the product page, which the customer then enters their personalisation details and clicks a PREVIEW button which will generate a new page with an image of the product they are viewing, with their personalisation featured on the product.

Is this not something that can be done within the Zen Cart product pages?

Many thanks.

7 Nov 2011, 10:46 PM
#5
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Text Editor CKEditor turns 'Button' option into add to cart????

The way the Zen Cart product pages are built by default, the purpose of the form on the page is to be used to add-to-cart.

If you're wanting to make the page do something else for your unique needs, you're certainly welcome to. That would mean you'll need to move the entire add-to-cart architecture to another stage in the process, probably into your preview screen or whatever.
It would probably be best to build a new product type for that, so that your other products aren't forced into that alternate flow if they don't need it.