Advertisement:

Author Topic: Add a shopping cart button to a post  (Read 905 times)

Offline EL34

  • Jr. Member
  • **
  • Posts: 293
Add a shopping cart button to a post
« on: August 23, 2019, 12:02:36 PM »
On my forum, I have a buy-sell-trade board
I am the admin
I saw a post in a google search that said that admins are able to use this tag in post
Code: [Select]
[html][/html]
I would like to add a shopping cart button in post that leads back to my web store and adds an item to the shopping cart

I tested this code in a post and it does produce a button, but the button does nothing
It works fine in any web page on my web site

Is there a way for me to get a <form> button to work in a post?

Here's the code I tested



Code: [Select]
[html]
<form action="https://mywebsite.com/MyStore/shoppingcart.cgi" method="post"> 
<input type="hidden" name="ITEM_F1" value="CloseOutSale.gif" />
<input type="hidden" name="ITEM_SHIPTYPE" value="1" />
<input type="hidden" name="ITEM_OPTION1" value="Yard sale" />
<input type="hidden" name="ITEM_OPTION2" value="AA0"/>
<input type="hidden" name="ITEM_OPTION3" value="" />
<input type="hidden" name="QTY_MIN" value="0" />
<input type="hidden" name="QTY_MAX" value="1" />
<input type="hidden" name="ITEM_WEIGHT" value="1" />
<input type="hidden" name="ITEM_TAXTYPE" value="psdbi99.htm" />
<input type="hidden" name="ITEM_ID" value="misc item" />
<input type="hidden" name="ITEM_NAME" value="Test Item" />
<input type="hidden" name="ITEM_PRICE" value="1.00" />
<input type="hidden" name="qty" value="1" />
<input type="hidden" name="showcart" value="1" />
<input type="submit" name="dummy" value="Click here to add this item to your shopping cart" />
<input type="hidden" name="thispage" value="partsenter.htm" />
<input type="hidden" name="action" value="quickbuy" />
<input type="hidden" name="order_id" value="!ORDERID!" />
<input type="hidden" name="ITEM_CODE" value="!ITEMCODE!" />
</form>
[/html]

Forum History -> EZBoard -> YABB -> SMF 1.1.19 -> SMF 2.0.15

Online vbgamer45

  • Customizer
  • SMF Super Hero
  • *
  • Posts: 21,559
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: Add a shopping cart button to a post
« Reply #1 on: August 23, 2019, 12:36:01 PM »
Form tags will not work inside an SMF post.

A workaround would be be to to put that code in an iframe that insert the iframe into the post.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Offline EL34

  • Jr. Member
  • **
  • Posts: 293
Re: Add a shopping cart button to a post
« Reply #2 on: August 23, 2019, 03:14:43 PM »
Ok, thanks
I will give that a try
Forum History -> EZBoard -> YABB -> SMF 1.1.19 -> SMF 2.0.15

Offline EL34

  • Jr. Member
  • **
  • Posts: 293
Re: Add a shopping cart button to a post
« Reply #3 on: August 24, 2019, 06:48:27 AM »
Form tags will not work inside an SMF post.

A workaround would be be to to put that code in an iframe that insert the iframe into the post.

Thanks, but I can't figure out how to add the form above into an iframe?

The frame needs a source and there is no src page
The form creates a new shopping cart session page on the fly

How would I construct the iframe code?
Forum History -> EZBoard -> YABB -> SMF 1.1.19 -> SMF 2.0.15