Page 1 of 2 12 LastLast
Results 1 to 10 of 14
  1. #1
    Join Date
    Sep 2008
    Posts
    106
    Plugin Contributions
    0

    Default Making Amendments To Big Royal Mail Contribution - Need Guidance

    I am trying to amend the Big Royal Mail Contribution to add some missed functionality and need some advice on which files I should be amending.

    What I am wanting to do is to add a length and width field to the product description and to then add additional code to the BRM mod so it will filter items to be posted by width and length, not just weight. For myself I only need this to be applied to letter and large letter post because both have a width and length limit.

    An alternative to this would be to add the option to "turn off" some postage options in each product description and to then pass those not values to the BRM mod following purchase, which I think is likely to be allot harder than the first option, not least because in the first there is existing code that should just need some expansion.

    If anyone has any suggestions I would be most interested to hear them, because at the moment I really am not at all certain which files I should be modifying and would like to keep this as straightforward as possible.

  2. #2
    Join Date
    Sep 2008
    Posts
    106
    Plugin Contributions
    0

    Default Re: Making Amendments To Big Royal Mail Contribution - Need Guidance

    I think, looking through the Admin configuration, that I can add length and width values using the Option... options under Catalog, so, if this is so, that would sort adding the required values to the product...

  3. #3
    Join Date
    Sep 2008
    Posts
    106
    Plugin Contributions
    0

    Default Re: Making Amendments To Big Royal Mail Contribution - Need Guidance

    Forget the Option... options under Catalog - they don't do anything for you unless you are wanting to sell a range of coloured T-shirts or the like - anything else just produces a whole shed load of stupid error messages.



    Guess it's time to rewrite the files again...

  4. #4
    Join Date
    Sep 2008
    Posts
    106
    Plugin Contributions
    0

    Default Re: Making Amendments To Big Royal Mail Contribution - Need Guidance

    The attribute additions do work, but they are for displaying more info on the product listings themselves, not for admin or product type additions... and under the Attributes Controller, where it says Adding New Attributes, you need to click on the title under option name (so it is highlighted) otherwise clicking on the insert button won't insert the attribute.

  5. #5
    Join Date
    Sep 2008
    Posts
    106
    Plugin Contributions
    0

    Default Re: Making Amendments To Big Royal Mail Contribution - Need Guidance

    Right, I have now got Length and Width showing under Product Types - Product General, with True/False value selectors.

    For anyone following this, this was achieved through two database modifications, which basically involved little more than copying the line for product weight, and changing the details to show length and width in place of weight.

    I am now hacking a few files to make the amendments usuable...

  6. #6
    Join Date
    Sep 2008
    Posts
    106
    Plugin Contributions
    0

    Default Re: Making Amendments To Big Royal Mail Contribution - Need Guidance

    Four entries required in SQL, not two, and I now have a problem with main_template_vars.php:

    Code:
      // This should be first line of the script:
      $zco_notifier->notify('NOTIFY_MAIN_TEMPLATE_VARS_START_PRODUCT_INFO');
    
      $module_show_categories = PRODUCT_INFO_CATEGORIES;
    
      $sql = "select count(*) as total
              from " . TABLE_PRODUCTS . " p, " .
                       TABLE_PRODUCTS_DESCRIPTION . " pd
              where    p.products_status = '1'
              and      p.products_id = '" . (int)$_GET['products_id'] . "'
              and      pd.products_id = p.products_id
              and      pd.language_id = '" . (int)$_SESSION['languages_id'] . "'";
    
    
      $res = $db->Execute($sql);
    
      if ( $res->fields['total'] < 1 ) {
    
        $tpl_page_body = '/tpl_product_info_noproduct.php';
    
      } else {
    
        $tpl_page_body = '/tpl_product_info_display.php';
    
        $sql = "update " . TABLE_PRODUCTS_DESCRIPTION . "
                set        products_viewed = products_viewed+1
                where      products_id = '" . (int)$_GET['products_id'] . "'
                and        language_id = '" . (int)$_SESSION['languages_id'] . "'";
    
        $res = $db->Execute($sql);
    
        $sql = "select p.products_id, pd.products_name,
                      pd.products_description, p.products_model,
                      p.products_quantity, p.products_image,
                      pd.products_url, p.products_price,
                      p.products_tax_class_id, p.products_date_added,
                      p.products_date_available, p.manufacturers_id, p.products_quantity,
                      p.products_weight, p.products_priced_by_attribute, p.product_is_free,
    		  p.products_length, p.products_priced_by_attribute, p.product_is_free,
                      p.products_qty_box_status,
                      p.products_quantity_order_max,
                      p.products_discount_type, p.products_discount_type_from, p.products_sort_order, p.products_price_sorter
               from   " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd
               where  p.products_status = '1'
               and    p.products_id = '" . (int)$_GET['products_id'] . "'
               and    pd.products_id = p.products_id
               and    pd.language_id = '" . (int)$_SESSION['languages_id'] . "'";
    
        $product_info = $db->Execute($sql);
    
        $products_price_sorter = $product_info->fields['products_price_sorter'];
    
        $products_price = $currencies->display_price($product_info->fields['products_price'],
                          zen_get_tax_rate($product_info->fields['products_tax_class_id']));
    
        $manufacturers_name= zen_get_products_manufacturers_name((int)$_GET['products_id']);
    
        if ($new_price = zen_get_products_special_price($product_info->fields['products_id'])) {
    
          $specials_price = $currencies->display_price($new_price,
                            zen_get_tax_rate($product_info->fields['products_tax_class_id']));
    
        }
    The addition of this line:

    Code:
    		  p.products_length, p.products_priced_by_attribute, p.product_is_free,
    seems to be behind this problem:

    Code:
    1054 Unknown column 'p.products_length' in 'field list'
    in:
    [select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id, p.products_quantity, p.products_weight, p.products_priced_by_attribute, p.product_is_free, p.products_length, p.products_priced_by_attribute, p.product_is_free, p.products_qty_box_status, p.products_quantity_order_max, p.products_discount_type, p.products_discount_type_from, p.products_sort_order, p.products_price_sorter from products p, products_description pd where p.products_status = '1' and p.products_id = '5' and pd.products_id = p.products_id and pd.language_id = '1']
    ...which wouldn't be a problem if I could work out what needs to be fixed/amended/updated in order to fix it...

  7. #7
    Join Date
    Sep 2008
    Posts
    106
    Plugin Contributions
    0

    Default Re: Making Amendments To Big Royal Mail Contribution - Need Guidance

    I am now certain that the problem with

    Code:
    1054 Unknown column 'p.products_length' in 'field list'
    in:
    [select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id, p.products_quantity, p.products_weight, p.products_length, p.products_width, p.products_priced_by_attribute, p.product_is_free, p.products_length, p.products_priced_by_attribute, p.product_is_free, p.products_qty_box_status, p.products_quantity_order_max, p.products_discount_type, p.products_discount_type_from, p.products_sort_order, p.products_price_sorter from products p, products_description pd where p.products_status = '1' and p.products_id = '6' and pd.products_id = p.products_id and pd.language_id = '1']
    when I try to view my products in normal store format is connected to Admin -> categories.php... and from there the database.

    The snag is that I cannot identify which values the categories.php is referencing in the database and the search feature of MyPHP is worse than useless for this kind of problem.

  8. #8
    Join Date
    Jul 2005
    Posts
    537
    Plugin Contributions
    0

    Default Re: Making Amendments To Big Royal Mail Contribution - Need Guidance

    I remember seeing a shipping mod, I think it was canada post, that added width/height/length fields to the database. Might it be worth a look for inspiration?

  9. #9
    Join Date
    Sep 2008
    Posts
    106
    Plugin Contributions
    0

    Default Re: Making Amendments To Big Royal Mail Contribution - Need Guidance

    Found the database, but that is as far as I can take this unless someone can help with this thread. - Thanks for the advice Chuck I will take a look at that now.

    The current problem is that I have a buggy version of MySQL that will not allow the creation of new fields no matter what, so I need a workaround.

    The code I have been trying to use is as follows:

    Code:
    INSERT INTO products (Field, Type, Collation, Attributes, Null, Default)
    VALUES (1, 'products_length', 'float', '', '', 0), (2, 'products_width', 'float', '', '', 0)
    and is intended to be input into the products table.

    The 'manual' for MySQL makes it quite obvious that my version of MySQL is shot to hell or the above code would work, so this is as far as things can go unless there is a workaround somewhere...

  10. #10
    Join Date
    Sep 2008
    Posts
    106
    Plugin Contributions
    0

    Default Re: Making Amendments To Big Royal Mail Contribution - Need Guidance

    Chuck, you wouldn't happen to remember any further details about the Canada mod, would you?

    I have found what must be close on 500 posts and many of them are very long threads...

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. v150 Big Royal Mail 3.0
    By brittainmark in forum Addon Shipping Modules
    Replies: 361
    Last Post: 27 Mar 2026, 04:54 PM
  2. v154 Big / Basic Royal Mail??
    By Man from Mars in forum Addon Shipping Modules
    Replies: 1
    Last Post: 19 Apr 2016, 02:07 PM
  3. Big Royal mail
    By ben harry in forum Addon Shipping Modules
    Replies: 2
    Last Post: 20 Jul 2008, 01:11 PM
  4. Big Royal Mail - Big Error - Shipping Abroad
    By bleazy in forum Addon Shipping Modules
    Replies: 0
    Last Post: 14 Jul 2008, 03:01 PM

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