Creating a add to cart button program

concreteheadconcretehead Member
in General edited September 2009
We're going to create a button application that intertwines with foxycart...

The problem:
Today I was asked to change the prices of a product I had about 10 links throughout the site. It was a little tedious.

The solution:
A link creator and tag thingemy.

Basically, my best thinking so far says to have a page in my backend for creating products. I'm sure other services are available like expression engine and foxee? but I think that I don't want their whole service - i just want the updating of links.

So ideally, I'm thinking I can create a link with the options I want - discounts - weights - categories etc etc and save it to my database and give it a key like wiki styles e.g

[foxyLink xaoeuaxntp231]

whenever our data is parsed before printing will search through the output to see if there are any foxylinks being used. If so, grab the html for the button in the relative table and replace the the foxyLink key with the html.

I'm wondering though - might there be a better way to do this?

With the solution above I can update the links and they will change site wide. This will be cool because overall we have around 100+ links already throughout the site for roughly 10 products and both of those numbers are surely to grow.

Also it will potentially make it very easy for people other than myself who are still frightened by html and manually creating links to add products to the site.
Comments
  • brettbrett FoxyCart Team
    What language are you programming in? It's a good question with a (relatively) easy answer, but I'll try to give an example in your language of choice (if I know it).

    Realistically you probably should be looking into a CMS at some point, but for now some simple includes could work wonders.
  • php and mysql. I'm doing this on a wordpress site currently... but we've got our CMS and our own backend we are building to we can kind of overtake all the wordpress functionality we need. With the above solution I'd go to my custom create a button page and create a button, grab the code and paste it into my wordpress.

    I have created keys like this before and had it replace the keys in the content. I'm wondering is this the best way?
  • brettbrett FoxyCart Team
    Ah, ok. Well if Wordpress has some way to set and replace placeholders or values with a value from the database (or other single place to store the data) then that'd be great. Otherwise you could just do a little PHP includes and keep it fairly manual at this point. In other words, just have a file that defines your links, then where necessary include that file and do a little <? echo $link_a; ?>.
Sign In or Register to comment.