Textpattern Forum

You are not logged in. Register | Login | Help

#1 2012-07-26 10:43:49

vineonardo
Member
Registered: 2011-08-31
Posts: 128
Website

Textpattern base website, using .NET for ecommerce

Hello everyone,
So its like I had developed a simple but really huge website showcasing product images, in Textpattern. Its really working great.
Now the client wants to sell the products online, so they’ve hired ecommerce “expert” who will be using .NET to develop shopping cart & related things.

The thing is, when I had developed this website, it was not built to be an ecommerce website. I had used article images to make product galleries and each image is a product.

Images open in a lightbox, and client wants to add a buy button on that lightbox.

But the real problem is, the ecommerce developers are now asking me to provide them a way to add additional information to each image. Like cost, unique id(which can be txp’s unique id), category, some other things along the same line.

By default I have image, image thumb, title, alt, caption, category and image id.

Question #1

Can I add more custom fields to image itself? Like cost?

Question #2

Can all this information of each image, passed to MS SQL database?

I’ve thought may be XML can help but I dont know how. Is there any way by which I can replicate whole database, or atleast the txp_image table into MS SQL database of .NET application?

Also, is there any way I can update both the databases at the same time when I add images into Textpattern?

I know there’s a lot I’ve asked but I’m totally confused.

I hope I’ve explained it well, if not, please ask.

Thank you so much for your time, I appreciate it. :)

Offline

#2 2012-07-26 11:02:49

Dragondz
Moderator
From: Algérie
Registered: 2005-06-12
Posts: 1,134
Website

Re: Textpattern base website, using .NET for ecommerce

I think using articles for your product is easier than images, you must think of converting all product using articles instead of images (you can do that easily using jmd_cvs, than the other things become easy.

For passing data to another process you can use rah_external_output to output an xml using any kind of txp tags and le other dev handle the data to the cart.

Hope that helps you.

Cheers

Offline

#3 2012-07-26 11:12:06

vineonardo
Member
Registered: 2011-08-31
Posts: 128
Website

Re: Textpattern base website, using .NET for ecommerce

@Dragondz

Thanks for the suggestion, I’ll try that plugin.

About using articles for products instead of images, I’m not really sure how that will work. As there are more than 700 products right now. All have different categories, and only single image or two for each of them. Also they dont need to have a individual page for each product.

The current architecture is like domain/section/category/article.
In the article, I add all the products that come under the same category, its easy to maintain that way.

I’m not sure if I’ve understood your suggestion well. Do you think my way is wrong? I am also new to Textpattern so may be I might have made mistakes about the products management.

Thanks again for your time & suggestions. :)

Offline

#4 2012-07-26 11:32:17

Dragondz
Moderator
From: Algérie
Registered: 2005-06-12
Posts: 1,134
Website

Re: Textpattern base website, using .NET for ecommerce

Hi

The problem about using image for each product is how to add other data to each product, you can use caption or alt input to add extra data, but it s more difficult to manage those data no, it s my thought maybe another one can gives you a better idea.

Cheers

Offline

#5 2012-07-26 12:37:03

vineonardo
Member
Registered: 2011-08-31
Posts: 128
Website

Re: Textpattern base website, using .NET for ecommerce

@Dragondz
Oh, yes, you’ve a right point. It’d really help if I use articles instead of images, but again, i’ll need to post them as Sticky and also then there will be over 700 articles, right? :|

At this point where I’ve already posted those many images, how am I gonna make this change? Any suggestions?

I’ll trying that plugin you told me I’ve no idea how to use it, I’ll do some research!

Thanks again for everything! :)

Offline

#6 2012-07-26 13:22:45

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 5,799
Website

Re: Textpattern base website, using .NET for ecommerce

vineonardo wrote:

i’ll need to post them as Sticky and also then there will be over 700 articles, right? :|

You won’t necessarily need to use Sticky. But yes you would have 700 articles with the Article Image field containing the ID of the image in question, then custom fields to hold the rest of the metadata.

Although it may seem like a lot of work you can automate it to some degree. Remember you can use a Textpattern section to create any structure you like: a CSV file, XML, even “invalid” HTML if you wish. So I would proceed to write a Page template in a hidden section that uses <txp:images> and some suitable container logic to output the image ID, its category, name, etc into a comma-separated list. Untested but something like this:

Section, Status, Title, Title_html, Posted, AuthorID, Body, Body_html, Image, Category1
<txp:images>
products, 4,
<txp:image_info type="name, name" break="," />,
<txp:image_date format="%Y-%m-%d %H:%M:%S" />,
<txp:image_info type="author, caption, caption, id, category" break="," />
</txp:images>

Then view that section in your browser and you’ll get content out which you can Save As Images.csv. Import that back into your database wiith either phpMyAdmin or jmd_csv to populate your articles (backup first of course). You’ll get Articles with image names (e.g. dsc12345.JPG), which may or may be what you want so you might have to do some further manipulation around the Title/Title_HTML fields. You can use smd_wrap, rah_replace or pax_grep for that. If there are any other fields you want to populate then do it as part of the export. Shout if you need a hand.

Then you just need to go through and populate any additional info like custom fields (which you’d have to do anyway). The advantage of articles is that you get category browsing for free and more SEO exposure per product.

Oh, you’ll probably need to make an article category tree the same as your Images tree first. Might be as well to create that first before importing the data from csv.

Hope some of that helps.

Last edited by Bloke (2012-07-26 13:27:10)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern.

Txp Builders – finely-crafted code, design and Txp

Offline

#7 2012-07-26 14:25:18

vineonardo
Member
Registered: 2011-08-31
Posts: 128
Website

Re: Textpattern base website, using .NET for ecommerce

@Bloke

Oh, God! You are my hero! Thank you.
Your answer has solved the half of the problem for me, I’ll do a test run on my local server and see how it goes.
Its still like “a-lot-of-stuff-to-do” for me, but I’ll get to learn something new.

I have no words to describe how much I appreciate your efforts and time you spent in helping me out, even writing code for me!

Thanks a ton, thats all I can say I guess! :)

I’m gonna follow you on Twitter, if that’s ok!

Offline

Board footer

Powered by FluxBB