extending dukapress to other custom post types

Home Forums General Help extending dukapress to other custom post types

Tagged: 

  • This topic has 8 replies, 2 voices, and was last updated 10 years, 6 months ago by es.answers.yahoo.com/question/index?qid=20140604200417AA5GEuz.
Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #6099
    Rob
    Guest

    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

    #6101
    Wambere
    Keymaster

    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/

    #6102
    Rob Kay
    Guest

    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!

    #6105
    Rob Kay
    Guest

    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.

    #6133
    Wambere
    Keymaster

    Nice!!! 馃檪

    #6529
    MBT
    Guest

    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

    #58522
    adodayAcoucky
    Guest
    #87244
    Clothknk
    Guest
    #109626
    es.answers.yahoo.com/question/index?qid=20140604200417AA5GEuz
    Guest

    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.
© 2024 DukaPress. All rights reserved.
Design By Madoido.