Results 1 to 2 of 2
  1. #1

    Default Creating a new Option Type

    I'm a long time lurker on the forums, many thanks to everyone who contributes here as you've solved many problems for me over the years! I have finally got something I can't solve from searching alone - I have found bits and bobs of info but some is outdated.

    Basically, what I want to do
    is create a new Option Type - called Calendar. I'm going to pinch the javascript calendar from the Featured Products admin, allowing customers to select date as an attribute. I plan to base this Calendar Option Type on the Text Option Type. No pricing adjustment is required for the new type, so I can do away with the pricing by letter that the text option type uses.

    So far I have:

    • Added the Option Type to db table products_options_types
    • Added an entry for PRODUCTS_OPTIONS_TYPE_CALENDER in the db configuration table


    These two steps mean the new Calendar Option Type shows in admin, but I now need to add the code to handle things.

    What I need to know is every file I need to modify in order to have this new option type function correctly.

    I've looked at the installation procedure for Value GV-Mod, which creates a new option type allowing customers to set the value of a gift voucher. For this mod the following files are modified..

    /admin/attributes_controller.php
    /admin/option_name.php
    /admin/options_name_manager.php

    /includes/classes/shopping_cart.php
    /includes/functions/functions_lookups.php
    /includes/modules/attributes.php
    /includes/modules/pages/gv_send/header_php.php
    I'm assuming the bottom file is irrelevant to my cause, but can anyone tell me if I have to modify all of the other files, or whether any others can be eliminated?

    Any other information that may help me on my quest is also hugely appreciated. I'm an XHTML/CSS guy, not a PHP/SQL guy, so I'm working this out as I go along.

    Thanks for your time.

  2. #2

    Default Re: Creating a new Option Type

    Based upon the changes made to the files in Beez's Value GV-Mod, I've now modified the following files:

    /admin/attributes_controller.php
    /admin/option_name.php
    /admin/options_name_manager.php

    Changing these files was fairly straightforward, using the commenting Beez had put in his own modified files, so I feel I've made the right changes.

    I'm now trying to determine which of the remaining files I need to modify. If I could find out what modifying these files achieves in the case of the Value GV-Mod, I can hopefully understand the reasons why or why not I need to modify the files myself.

    I've put comments by the filenames, please can someone let me know if I'm on the right track.

    /includes/classes/shopping_cart.php - not sure, could relate to adjusting of prices, which I don't need for my Calendar attributes. Unsure whether I need to delve into this one.

    /includes/functions/functions_lookups.php - not sure, seems to relate to input validation. Again don't know if I need to modify it or not.

    /includes/modules/attributes.php - definately need to modify, relates to the display and handling of the attributes. Will make new sections for my calendar option type, based upon the changes made by Beez for his value mod type.

 

 

Similar Threads

  1. v154 Creating a new product type
    By DannyVarley in forum General Questions
    Replies: 3
    Last Post: 22 Jan 2015, 05:45 PM
  2. Instructions on creating a new product type?
    By informability in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 20 Jul 2009, 06:00 PM
  3. Creating a new General Product Type
    By timps in forum Setting Up Categories, Products, Attributes
    Replies: 10
    Last Post: 1 Oct 2007, 03:11 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg