Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

OSC Developer help - need to build a product dependant php script


lindsayanng

Recommended Posts

So I have a pretty great idea and it would make an AWESOME osc contribution.. Clearly everyone is moving towards integrating their own blog with their store.. also, using the back end system of wordpress to manage images on OSC is a great way to make an oscommerce site more user friendly for clients.

 

I have already successfully pulled images based on category to the home page of osc. The code basically pulls the all powerful wp-load.php without using the theme.. Then from there you can use just about any wordpress function you want. So I pulled the get_post_attachment to generate the first image in the post and displayed that on my osc page. It works perfectly..

 

So the next step is this:

 

I have a wordpress plugin called media tags. It lets you set specific tags to images and files you upload. So if i upload pictures of my dogs, my cats, and me.. I can tag the dog pictures 'dogs' and the cat pictures 'cat' and the me pictures 'me' .. then anywhere within wordpress (or oscommerce) I can use the get_attachments_by_media_tags query to pull images based on one or a few tags.. So if i want an all pets page I use this:

 get_attachments_by_media_tags(get_children('media_tags=cats,dogs&post_type=attachment&post_mime_type=image&post_parent=' . $iPostID ));

 

So the ULTIMATE way to make this work is to make it so that the product pages will adjust the media_tags selector based on the product (or category) ..

 

Since i am still new with osc, I need some php coder help on this..

 

The goal is to create a field in the create product (or possible the create category) page where you can insert the media tag slug that you want to use to pull images from. So at the bottom where you have the upload photos forms, you will have a "media tags" form. This will insert the media tag into the DB ..

 

then i need the code to pull the tag name from the DB and insert it into that query that I posted earlier.

 

Like I said.. it's a project.. I am working with the creator of the media tags plugin for wordpress.. he's helping me, but I could definitely use some help from this community as well.

 

Thanks in advance

A great place for newbies to start

Road Map to oscommerce File Structure

DO NOT PM ME FOR HELP. My time is valuable, unless i ask you to PM me, please dont. You will get better help if you post publicly. I am not as good at this as you think anyways!

 

HOWEVER, you can visit my blog (go to my profile to see it) and post a question there, i will find time to get back and answer you

 

Proud Memeber of the CODE BREAKERS CLUB!!

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...