We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 32678
    • 290 Posts
    Hello --

    I am developing a gallery web site system that provides a completely configurable Web site to the end user (a photographer). This project is mostly complete, and currently I’m working on the ecommerce component (I don’t think this an ecommerce question, though, which is why I’ve posted here). The 80/20 rule applies to selling prints -- 20% of a photographer’s prints account for 80% of revenue. This means that for the bulk of a photog’s portfolio, prices and print options can be uniform. For the 20% providing the majority of revenue, I would like the pricing to be customizable.

    Here are the challenges I’m contending with. First, print options and prices are set by the photographer, and there could be any number of combinations for these. Second, I’m trying to figure out how to programatically populate a form dropdown field with the price/option combinations (the price sets) that the photog derives. An example price set might contain three print sizes, each with three print options (i.e. print only, mounted, mounted and framed), and a unique price for each of these combos. In consideration of the 80/20 rule described above, there will probably be the need for 3-4 pricing sets - one standard that’s applied to 80% of the portfolio, and then 2-3 others that are applied as needed to by the photog to the rest of his or her portfolio. Finally, once on of these pricing combos is selected, I need to get the values into the cart.

    Images are selected for purchase using the aforementioned dropdown field and an ’add to cart’ or ’purchase now’ button present on each image page. I envision providing the photog the ability, when creating the image page, to select the pricing set for that image using the getChunk method (http://wiki.modxcms.com/index.php/Create_TV-Based_Chunks). Then, when the site visitor makes a selection, the price value and option value of the selected item is placed into the cart.

    Here’s where I could use ideas from the wizards. First, is there a way in MODx to populate the values present within the dropdown field from, say, an external file? If so, the photog could complete the csv (call it ’standardPricing.csv) and save it to a prescribed location via the manager. This process could be repeated for custom pricing sets via customPricing1.csv, etc.). These files could then populate form dropdown fields held within their respective chunks.

    Or am I smoking poppies?
      • 22303 MODX Staff
      • 10,725 Posts
      Quote from: wpicotte at Jul 04, 2010, 07:49 PM

      Here’s where I could use ideas from the wizards. First, is there a way in MODx to populate the values present within the dropdown field from, say, an external file? If so, the photog could complete the csv (call it ’standardPricing.csv) and save it to a prescribed location via the manager. This process could be repeated for custom pricing sets via customPricing1.csv, etc.). These files could then populate form dropdown fields held within their respective chunks.
      Sure, you can use @EVAL bindings to populate the selection from anything you can process with PHP. I would create a snippet that you execute using @EVAL to read the file and return the values you need.
        • 32678
        • 290 Posts
        Thanks for your reply. I was afraid this would be the answer -- I don’t know PHP very well.