varunsridharan / woocommerce-quick-donation

Online Donation Using Woocoomerce. for woocommerce user's
https://wordpress.org/plugins/woocommerce-quick-donation
GNU General Public License v2.0
7 stars 11 forks source link

Unable to overwrite template #12

Closed iwakun closed 9 years ago

iwakun commented 9 years ago

I've created a 'donation-form.php' and placed it in the 'mytheme/woocommerce/donation' folder. However, the plugin still uses the generic template.

I think the error is somewhere in the class-quick-donation-functions.php file around line 155 in the 'wc_locate_template' function. If I echo $template_full_path on the first line, it's the custom template file, but when I echo it out before the return, it's the default template file.

It looks like it will use the default if the template name is found in the 'general' section. Not sure why you want to do this, but I think that's what is happening.

varunsridharan commented 9 years ago

Hi,

Thanks for reporting will change and update you

erralb commented 9 years ago

+1 same problem here...

varunsridharan commented 9 years ago

@ierpe

today i will check and update . :)

varunsridharan commented 9 years ago

Hi,

Kindly go to plugins/woocommerce-quick-donation/includes/class-quick-donation-functions.php on line 42 you will find a line with the same code add_filter( 'woocommerce_locate_template' , array($this,'wc_locate_template'),10,3); kindly come it. for now. i will release it with other bug fix by today or tomorrow

erralb commented 9 years ago

Still not working for me. If I echo $locate in the function locate_template line 147, I get :

/home/piero/www/bicewp/web/app/plugins/woocommerce-quick-donation/template/fields/field-select.php
/home/piero/www/bicewp/web/app/plugins/woocommerce-quick-donation/template/fields/field-text.php
/home/piero/www/bicewp/web/app/plugins/woocommerce-quick-donation/template/donation-form.php

I am using the BedRock stack , maybe that has something to do with it? It seems that it does not reach the woocommerce folder in my theme...

varunsridharan commented 9 years ago

@ierpe can you please download the unreleased version of this plugin and check Download link : http://varunsridharan.in/woocommerce-quick-donation.zip

erralb commented 9 years ago

Hi, how are you today? :)

I tried with this version but same thing...

When I echo $locate from line 178 in class-quick-donation-functions.php, I still get :

/home/piero/www/bicewp/web/app/plugins/woocommerce-quick-donation/template/fields/field-select.php /home/piero/www/bicewp/web/app/plugins/woocommerce-quick-donation/template/fields/field-text.php /home/piero/www/bicewp/web/app/plugins/woocommerce-quick-donation/template/donation-form.php

Just to be sure I'm doing things right... my custom form template is in :

/web/app/themes/BICE/woocommerce/donation/donation_form.php

While BICE is the theme I'm currently working on. Is that correct?

Pierre

On 21 October 2015 at 12:03, Varun Sridharan notifications@github.com wrote:

@ierpe https://github.com/ierpe can you please download the unreleased version of this plugin and check Download link : http://varunsridharan.in/woocommerce-quick-donation.zip

— Reply to this email directly or view it on GitHub https://github.com/technofreaky/woocomerce-quick-donation/issues/12#issuecomment-149844060 .

Pierre

varunsridharan commented 9 years ago

No,

i have updated the code but not changed the version

varunsridharan commented 9 years ago

note that its not donation_form.php its donation-form.php

erralb commented 9 years ago

haaa! It's working now... it's weird because I'm pretty sure I copied the file from the template folder... It's working, even with the last github version

varunsridharan commented 9 years ago

ho nice

kindly use the version which i gave using download link . soon i will release it in wp plugin directory

erralb commented 9 years ago

ok!