This is the P2PU Archive. If you want the current site, go to www.p2pu.org!

WordPress Development

My recent threads

You haven't posted any discussions yet.

Recently updated threads

Last assignement urls

Go back to: General discussion

Hello,

Very recently I have had to implement a small online shop in a real client project, and I did it with eshop. So I have had some experience in last weeks that help me a little  in this exercise, but not entirely because in the real project we have not custom post types.

You can go there directly with this link or wit the "shop" menu option in the top menu. [update: this is the url of the assignment]

http://tresxnou.cat/beta/2010curswp/curs_photos/shopping/

This is what I did:

  • Install and setup eshop plugin
  • Add function to functions.php in order to enable eshop for custom post types:

add_filter('eshop_post_types','mycustomtype');

function mycustomtype($array){
$array[]='mytype';
return $array;
}

  • Edit the functions.php , in the create_post_type() function, add in the supports array the 'page-attributes' suport, that I did'nt put before, and is needed, in conjunction with the  "hierarchical" parameter set to true, to show the Parent option when editing our custom post "photo" type.
  • Create a new custom post "photo" called "Shop" and add inside the shortcode of eshop that lists all article
[eshop_list_subpages class='botiga' form='yesqty' imgsize='80']

Then, the "photo" posts yet created, must be modified to make sons of the recent "Shop" created post and to full the new fields related to description and price and product options.
  • We can add more new posts with new photos and their prices.
  • But, we must edit also the eshop-shortocdes.php because in  the function that use [eshop_list_subpages} shortcode, the variable $pagetype is set to page:
$pagetype=apply_filters('eshop_sub_page_type','page');

If we want that this function lists our photos in the "Shop"parent page, we need to change this line:

$pagetype=apply_filters('eshop_sub_page_type','curs_photos');

  • At least, to make all beautifaul, we must make changes in the eshop.css file that the plugin install in a subfolder of uploads (something very odd).
  • I also modified the single-photo.php file to exclude the shop index "photo" page from the same layout that the single posts have to show the 'photo' custom fields.

I could not achieve to show the shopping cart in the sidebar. But this will be in another time. So, more or less, this is all.

Have a nice weekend.

Núria

Danny Smith's picture
Danny Smith
Sat, 2011-03-19 20:47

Very nice looking site. I had never done an ecommerce site before this lesson. Because of time constraints, I took the easy way out, but need to go back and re-visit this. Is eshop the best you think?

Núria Ramoneda Aiguadé's picture
Núria Ramoneda Ai...
Wed, 2011-04-06 01:08

Hello, I was very busi this lasts weeks, I apologize to not answer till now.
Danny, Nuno: for me was the first time to do an ecommerce site this experience wiht carrosdefoc.com, so I can't say if eshop is the best or not. To choose it I read in forums and blogs about the different solutions for ecommerce under wordpress, searching for one that was very simple, because I didn't need to pay online, only make an email with the order done.
From e-commerce (http://www.instinct.co.nz/e-commerce/) I read a lot of bad comments so I descard it. But I haven't done a very deep research and compare about it.
At this moment, I can say thaht eshop have some problems that may be overcome, but I don't know if others had the same or not.

Danny Smith's picture
Danny Smith
Sun, 2011-03-20 02:47