Home › Forums › General Help › extending dukapress to other custom post types
Tagged: outlet
- This topic has 8 replies, 2 voices, and was last updated 10 years, 4 months ago by es.answers.yahoo.com/question/index?qid=20140604200417AA5GEuz.
-
AuthorPosts
-
May 16, 2012 at 12:33 pm #6099RobGuest
I have several plugins that use a custom post type to organise their data. One example would be http://www.abstractsun.com/artists/mas-law/ that uses custom posts to organise artists/albums/tracks for a record label. I would like to add ‘add to cart’ buttons for eah track (which is a custom post of type ‘song’). I wondered if you had any suggestions/hints for achieving this. I can only think of two options at the moment.
1) creating a separate product for each song then writing another display-product-shortcode function to display that product’s ‘add to cart’ button next to the song in the list. This is not ideal as my client would need to create both a ‘song’ post type and a ‘product’ post type.
2) Adding the required custom fields to the ‘song’ post type then finding a way for dukapress to work with this post type as well as it’s own. This would be ideal but I’d need a few hints as to what custom fields i’d need and where dukapress needs extending to access other post types…If you have any suggestions I’d love to hear them:-) It’s great to see such a quality product released fully as open source – I’d really like to extend it in the process of solving my client’s problems!
Rob
May 16, 2012 at 4:58 pm #6101WambereKeymasterWell, it is possibly to write another function based on the function that generates the “[dpsc_display_product]” shortcode.
However, what happens when you put in this shortcode in your custom post types? Theoretically, it should work perfectly. The only thing that would be missing would be the product details meta box (for defining the price, etc).
But you can go around that by using custom fields directly – please see: http://dukapress.org/docs/custom-fields-used/
As for the “grid display” shortcode, it actually takes a parameter to define the post type so no problem there 馃檪 See: http://dukapress.org/docs/short-codes/
May 16, 2012 at 7:50 pm #6102Rob KayGuestThanks for speedy response – much appreciated!
So if I’m understanding this right I could create the same custom fields for my post type as described in your document and then write a new [dpsc_display_product] that works for my post type. It would just display the product name, an mp3player link and an ‘add to cart’ button. (the previous two I have the code already)
Assuming I got the above right, would my ‘add to cart’ button function happily with the shopping cart or is there anything else I would need?
I noticed the grid view, post type parameter. It’s a bit of a last resort for me to effectively scrap all my existing display code but I could investigate. So you’re saying if I added the right custom fields to a custom post type, I could just display those custom posts as products using grid view & they’d work fine with the shopping cart?
Thanks again, I appreciate your time thinking about this!
May 17, 2012 at 1:26 pm #6105Rob KayGuestSuccess! Tried the former approach (new display product function) and it seems to be working fine:-) I’ll post something here when I have a finished plugin.
May 21, 2012 at 2:54 pm #6133WambereKeymasterNice!!! 馃檪
August 9, 2012 at 3:42 pm #6529MBTGuestI’m trying to do the same thing… extending dukapress to custom post types. Can you tell me how to do that? What is the code that ypu use in your functions.php?
Thanks in advanceSeptember 4, 2013 at 10:53 pm #58522adodayAcouckyGuestDecember 12, 2013 at 2:55 pm #87244ClothknkGuestJune 25, 2014 at 5:27 am #109626es.answers.yahoo.com/question/index?qid=20140604200417AA5GEuzGuestHoy en d铆a, la marca Christian Louboutin zapatos de tac贸n alto a un precio de m谩s de $ 500, los clientes siguen llegando, 煤nico encanto rojo es evidente. Como un contempor谩neo del famoso dise帽ador de calzado, Christian Louboutin es sin duda la exposici贸n m谩s alta, su figura aparece a menudo en diversos Parte. Us贸 un alto perfil, actitud publicidad cambi贸 los dise帽adores de calzado tradicionales abogan por el interior, y puede r谩pidamente se convirti贸 en una estrella internacional en un corto tiempo, su “marketing” encanto personal negada. 脡l dise帽贸 los zapatos no puede ser el mundo m谩s c贸modo, pero debe ser el m谩s singular.
-
AuthorPosts
- The forum ‘General Help’ is closed to new topics and replies.