Problem occured because VirtueMart theme directory is different


  • Your avatar
    seyi    
     5 years ago
    0

    Hi,

    1)
    I have problem with Add Shipping fields to Coupon Form (Installation checked). And i found one reason to that.. We have different theme than default in use.
    I trace this problem and modify default/templates/common/couponField.tpl.php and it gives all good in installation check.
    It wont disappear if i change code in our theme so its a problem :D

    2)
    Im not sure that is this same reason why we have also this error in minicart: Warning: Cannot modify header information - headers already sent by (output started at $webroot/subfolder/administrator/components/com_virtuemart/classes/ps_checkout.php:1) in $webroot/subfolder/administrator/components/com_virtuemart/classes/ps_checkout.php on line 55

    It comes when adding product to cart but disappear when continueing to checkout or keep browsing.

    I have not tested further so i dont know yet is there more to coming.

    Thank you all for possible answers! Keep up good work.
  • Your avatar
    seyi    
     5 years ago
    0

    1) It should check the template you are using before installing the injection. But if that is not working you can do this manually. Take a look in the user_guide.html, section 5.1.2. Follow the instructions there to add it to your template.

    2)you should take a look at those lines. the error means that something is writing to the screen before it is ready. at line 1 just verify there is not a space there before the beginning of the php tag.
  • Default avatar
    ilDirty    
     5 years ago
    0

    Hi,

    1) I have done it allready, now twice actually but no change :(

    In Installation check it will change ok IF i add 5.1.2 code to default template instead of ours. My guess is that somehow code will not note right template.

    2) I have solved that.
  • Your avatar
    seyi    
     5 years ago
    0

    Is the problem that it is not working when you test? Or it is not showing correctly on the installation check page?

    Also if you go to the admin section and go to virtuemart->admin->configuration->site tab and look at 'Select the theme for your Shop' is it set to your current template or default?
  • Default avatar
    ilDirty    
     5 years ago
    0

    I havent tested it further because it doesent show correctly on the installation check page.

    Current template is selected in config.
  • Your avatar
    seyi    
     5 years ago
    0

    I would suggest to keep on testing as I believe it would work even if it does not show as installed.

    But back to the check, I have looked at the code, and it is looking for VM_THEMEPATH. In virtuemart.cfg.php you probably have something like this
    <?php
    define
    'VM_THEMEPATH'$mosConfig_absolute_path.'/components/com_virtuemart/themes/default/' );
    ?>

    where default is your template path

    And so it is looking to see if this file exist:
    www/components/com_virtuemart/themes/[my_theme]/templates/common/couponField.tpl.php

    and if it cannot find it, then it default to the default:
    www/components/com_virtuemart/themes/default/templates/common/couponField.tpl.php

    I do not understand why it is not working for you.

    Using is_file (http://uk2.php.net/manual/en/function.is-file.php) to check if the file exists, would there be any reason it fails that check?