extending dukapress to other custom post types

Home Forums General Help extending dukapress to other custom post types


This topic contains 8 replies, has 2 voices, and was last updated by  es.answers.yahoo.com/question/index?qid=20140604200417AA5GEuz 3 years, 8 months ago.

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
  • #6099


    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!




    Well, 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/


    Rob Kay

    Thanks 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!


    Rob Kay

    Success! 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.



    Nice!!! ­čÖé



    I’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 advance





    Hoy 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.

Viewing 9 posts - 1 through 9 (of 9 total)

The forum ‘General Help’ is closed to new topics and replies.

© 2018 DukaPress. All rights reserved.
Design By Madoido.