Page 1 of 2 12 LastLast
Results 1 to 10 of 28

Hybrid View

  1. #1
    Join Date
    May 2014
    Location
    UK
    Posts
    317
    Plugin Contributions
    0

    Default Re: products_date_available no longer NULL

    Quote Originally Posted by mc12345678 View Post
    Already mentioned update_info (for the product type of your merch, there's also collect_info which preps the data for display... How do all of these product type files differ from a vanilla install? What product type is in question? Have you tried this operation using a different product type to see how it behaves? (Sort of like using a different template when troubleshooting display issues...)
    Ok Products General is the norm - that's putting the zeroes in - Documents General is putting NULL into the database

  2. #2
    Join Date
    Jul 2012
    Posts
    16,816
    Plugin Contributions
    17

    Default Re: products_date_available no longer NULL

    Quote Originally Posted by DigiBooks View Post
    Ok Products General is the norm - that's putting the zeroes in - Documents General is putting NULL into the database
    So, something is different about the files for the product than product_document... And more than likely that difference may be seen by comparing your files against a vanilla set... There's not many files to compare in that sub-folder...
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  3. #3
    Join Date
    May 2014
    Location
    UK
    Posts
    317
    Plugin Contributions
    0

    Default Re: products_date_available no longer NULL

    Quote Originally Posted by mc12345678 View Post
    So, something is different about the files for the product than product_document... And more than likely that difference may be seen by comparing your files against a vanilla set... There's not many files to compare in that sub-folder...
    So check admin/includes/modules/document_general files and admin/includes/modules/document_product files against a fresh donwload is where I think you're advising me to check?

    I know we haven't changed anything in these sections but it's a starting point :)

  4. #4
    Join Date
    May 2014
    Location
    UK
    Posts
    317
    Plugin Contributions
    0

    Default Re: products_date_available no longer NULL

    Quote Originally Posted by DigiBooks View Post
    So check admin/includes/modules/document_general files and admin/includes/modules/product files against a fresh donwload is where I think you're advising me to check?

    I know we haven't changed anything in these sections but it's a starting point :)
    Sorry I think these are the two folders you meant?

  5. #5
    Join Date
    Jul 2012
    Posts
    16,816
    Plugin Contributions
    17

    Default Re: products_date_available no longer NULL

    Quote Originally Posted by DigiBooks View Post
    Sorry I think these are the two folders you meant?
    Those last two would be my suggestion though I would start with product, because document_general is working as expected... The other thing, do you have any plugins installed that possibly modify the number of fields in the products table or display "extra" fields on the data input screen?
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  6. #6
    Join Date
    May 2014
    Location
    UK
    Posts
    317
    Plugin Contributions
    0

    Default Re: products_date_available no longer NULL

    Quote Originally Posted by mc12345678 View Post
    Those last two would be my suggestion though I would start with product, because document_general is working as expected... The other thing, do you have any plugins installed that possibly modify the number of fields in the products table or display "extra" fields on the data input screen?
    Thank you for pointing me in the right direction ... with your advice and trusty old Winmerge I found one difference in admin/includes/modules/preview_info.php

    Instead of:

    if ($pInfo->products_date_available > date('Y-m-d')) {

    it read:

    if (true || $pInfo->products_date_available > date('Y-m-d')) {

    Now I remember changing this because we didn't want our site to say books will be available on a specific date but we use it as an EXPECTED date (they don't necessarily publish on time).

    So I reset it to the vanilla setting and all seemed to work. The other thing we don't want is when a book goes past it's due date that it automatically gets set to available (products_date_available set to NULL). So I changed it back and all seemed OK - no zeroes in the field but the past due date was reset to null.

    My conclusion is that I didn't make that (true || ... statement correct in the first instance.

    So digging further I find that the field is reset in admin/includes/modules/update_product.php where it states:

    $products_date_available = (date('Y-m-d') < $products_date_available) ? $products_date_available : 'null';

    so I have replaced this with:

    // Stop removing past due by dates
    // $products_date_available = (date('Y-m-d') < $products_date_available) ? $products_date_available : 'null';
    if ($products_date_available == '') { $products_date_available = 'null'; }
    //


    That works a treat - no more zeroes in the database and past due dates are retained until we manually remove them!

    All I have to do now is find the product info page and stop any past due book from allowing Add To Cart,

    Thank you for your patience and assistance to someone to whom certain PHP statements are actually NOT logical!!!!

  7. #7
    Join Date
    Jul 2012
    Posts
    16,816
    Plugin Contributions
    17

    Default Re: products_date_available no longer NULL

    Quite welcome. Whatcha mean though about having to find the product info page? The "start" of it is the header in includes/modules/pages/product_info then the chase starts with the applicable tpl file. :)

    Don't forget tools such as the developer's toolkt, the resulting web page source, etc... :)
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  8. #8
    Join Date
    May 2014
    Location
    UK
    Posts
    317
    Plugin Contributions
    0

    Default Re: products_date_available no longer NULL

    As always I appreciate all your help. I did load a fresh install that I will leave to play around with and see if I can recode the Expected Products section correctly as I learn more.

    I think the problem is that whist we are a little different to other "shops" I still don't believe that any system should have an automatic right to clear expected dates.

    For instance, say, a clothes shop might say something will be in stock on a particlar date and once past reverts to saying that it is in stock - but the stock may have been delayed and not arrived and therefore cannot be supplied.

    I think these decisions should be under the store owner's control. Maybe that is something that can be looked at in future releases :)

  9. #9
    Join Date
    Jul 2012
    Posts
    16,816
    Plugin Contributions
    17

    Default Re: products_date_available no longer NULL

    Quote Originally Posted by DigiBooks View Post
    As always I appreciate all your help. I did load a fresh install that I will leave to play around with and see if I can recode the Expected Products section correctly as I learn more.

    I think the problem is that whist we are a little different to other "shops" I still don't believe that any system should have an automatic right to clear expected dates.

    For instance, say, a clothes shop might say something will be in stock on a particlar date and once past reverts to saying that it is in stock - but the stock may have been delayed and not arrived and therefore cannot be supplied.

    I think these decisions should be under the store owner's control. Maybe that is something that can be looked at in future releases :)
    First of all want to say I agree that there should be a way to prevent the auto-trigger of active status in absence of some outside trigger (in the case described above, receipt of material) and it has been requested in one way or another over time... There has also been discussion of turning off a product by date... Not everyone uses both or either, but that's also what plugins are about.

    As to the thought of a product's availability versus it being "active" on the site, there's also the concept of pre-orders and well, the need (or lack of) controlling the ability to purchase upon it being in one's hands... Might be worth looking through the numbers to see 1) what is the history of never receiving a product, 2) what is the history of timeliness of delivery by an organization, etc.., 3) what is your product view history like and that over time? There may be ways that the store can increase income, by taking advantage of some of those facts from a business perspective.

    The big thing though is that hardly can a product be put together that completely covers every aspect, every site owner straight out of the box, but having enough flexibility to shape it to the individual needs... Priceless..
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  10. #10
    Join Date
    May 2014
    Location
    UK
    Posts
    317
    Plugin Contributions
    0

    Default Re: products_date_available no longer NULL

    Quote Originally Posted by mc12345678 View Post
    First of all want to say I agree that there should be a way to prevent the auto-trigger of active status in absence of some outside trigger (in the case described above, receipt of material) and it has been requested in one way or another over time... There has also been discussion of turning off a product by date... Not everyone uses both or either, but that's also what plugins are about.

    As to the thought of a product's availability versus it being "active" on the site, there's also the concept of pre-orders and well, the need (or lack of) controlling the ability to purchase upon it being in one's hands... Might be worth looking through the numbers to see 1) what is the history of never receiving a product, 2) what is the history of timeliness of delivery by an organization, etc.., 3) what is your product view history like and that over time? There may be ways that the store can increase income, by taking advantage of some of those facts from a business perspective.

    The big thing though is that hardly can a product be put together that completely covers every aspect, every site owner straight out of the box, but having enough flexibility to shape it to the individual needs... Priceless..

    I totally agree with everything you're saying .. I guess we're just trying to do something that could be considered outside of the box .. we'll find a wayto get around the problem and in the meantime we will use the vanilla install to see if we can identify where our testing of dates really should sit :)

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 7
    Last Post: 4 May 2016, 01:59 AM
  2. Get products_date_available
    By mprough in forum General Questions
    Replies: 4
    Last Post: 10 Sep 2014, 01:40 PM
  3. Replies: 3
    Last Post: 24 Sep 2012, 07:08 PM
  4. Replies: 11
    Last Post: 15 Jan 2010, 04:44 PM
  5. Adding products_date_available field in product_listing.php
    By Camel in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 29 Nov 2006, 08:41 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