Hi I am using 4.1.10, and just changed to a Sigma template. I have read through an understand from a 68c side how to remove the price field from the check out process. When using a 68c template, I had it working as desired. However, when I changed to the Sigma series template, I can now no longer remove the price field from certain categories using the quick checkout module like I was once able to do using the methods provided by 68c. Any suggestions how to do this? Looking around the forums for 68c templates it is a common request and they have addressed it with 'noprice.tpl' and built it into the category page in Admin, I am assuming/hoping it would be an easy fix and it will also be built into the quick checkout module in Sigma. Cheers
noprice.tpl is not a standard part of 68C and therefore not integrated with the quick checkout module. In step3.tpl of the templates in the quick checkout module there is a test which is standard {if $checkoutDisPrice == "Y"} Are you saying this test is is not working having set it to NO in your admin control panel under checkout settings? Quick solution: You could just deactivate the quick checkout module and use the standard checkout process.
I checked the code in step3.tpl, it is as you describe, it has not been altered since uploading. Under checkout settings, the 'Allow Price Feild' is set to 'Yes' as it is only 3 categories out of about 15 that I do not wish to have a prce field. Previously, to deselect price categories for certain categories, I simply selected 'Hide Price' under the 'Category Setup' for the desired category. My site is not up and running yet, so I don't need the quick solution, but I am hoping there is another solution as reverting back to the original checkout method is taking a step backwards. Cheers
Agreed the Quick One page checkout is cool. I will look at finding a general solution but it may take time. It may be down to Eric offering you a quick mod to his module.
I just took a look at this and it will require a bit more investigation. When you use the admin control panel checkout settings to say price field is equal to NO, it correctly sets the variable $checkoutDisPrice to' N' . You can set it to NO and the price field is not shown in the Quick Checkout module. All is fine and as it should be. However, when I use the custom cats module and set the price to NO (hide price), the variable still remains equal to YES and of course the Quick Checkout modules correctly evaluates the variable as equal to YES.
I look forward to seeing how you go with this. The coding changes we have played around with have resulted in little success.
You are going to need to modify files in both modules because there were no hooks present. We do not support this but here we go: The following changes are required: Custom cats hooks.php file: replace the function in question with this function listing_no_price($id=FALSE) { /* global $db, $category, $class_tpl, $step; $ccnoprice = 'N'; if (!$category) { $category = $class_tpl->get_template_vars('category'); } if($id) { $sSQL = 'SELECT section FROM '.PREFIX.'listings WHERE id='.(int)$id; $result=$db->query($sSQL); $rs=$result->fetch(); $id=$rs['section']; unset($sSQL); $sSQL = 'SELECT ccnoprice FROM '.PREFIX.'categories WHERE id='.(int)$id; $result=$db->query($sSQL); $rs=$result->fetch(); $ccnoprice = $rs['ccnoprice']; } elseif($step==3 && $category) { $sSQL = 'SELECT ccnoprice FROM '.PREFIX.'categories WHERE id='.(int)$category; $result=$db->query($sSQL); $rs=$result->fetch(); $ccnoprice = $rs['ccnoprice']; } if($ccnoprice=='Y') { $class_tpl->assign('checkoutDisPrice', 'N'); } */ //replacement to work in qc mod $Db = Library::loadDb(); $Template = Library::loadLibrary( 'Template' ); $ccnoprice = 'N'; $category = $Template->get_template_vars( 'category' ); $sql = 'SELECT ccnoprice FROM ' . PREFIX . 'categories WHERE id=' . (int) $category . ' LIMIT 1'; $Result = $Db->query( $sql ); $row = $Result->fetch(); if ($Result->size() == 1 && !$Db->isError()) { $ccnoprice = stripslashes($row[ 'ccnoprice' ]); if ($ccnoprice == 'Y') { $Template->assign('checkoutDisPrice', 'N'); } } $Result->freeResult(); } Then add this aswell into function customcats_events(&$modules) $modules->register('modify_listing', $this, 'listing_no_price'); $modules->register('qc_step3_form', $this, 'listing_no_price'); $modules->register('viewlisting_end', $this, 'viewlisting_end'); Then in index.php of the quick checkout module you will need 2 new two lines inserted at around line 122 so replace case 'checkout3': //displays the listing form require_once 'includes/QC_Listings.php'; $QC_Listings = new QC_Listings($_GET); $QC_Listings->listingForm(); $Template->display('quick_checkout/checkout/step3.tpl'); exit(); with case 'checkout3': //displays the listing form require_once 'includes/QC_Listings.php'; $QC_Listings = new QC_Listings($_GET); $QC_Listings->listingForm(); $Modules = Library::loadLibrary ('Modules'); $Modules->call_hook( 'qc_step3_form', ''); $Template->display('quick_checkout/checkout/step3.tpl'); exit();
Ok. I might need some more assistance. The second part (adding the 2 lines) not a problem. For the hooks.php as above, I want to make sure I am doing it right as I am still getting the price field appearing in the qc process for categories that I have set as 'Hide Price'. Basically, at line 53 of the hooks.php file, I replace script with what you provided, but I am not getting any changes. As I see it, in the above quoted, the first section is exactly the same as the original, except you have added /* and */, then I add the second part under that. Maybe i'm making a breakfast of this and completely doing it wrong. Some further guidance would be greatly appreciated. Cheers
Lets make this easy - contact me at TemplateCodes and I will send you the two replacement files. - I just spotted a small extra change that I forgot to add in so not your fault. It is in the post now above marked in red.
Thanks for the assistance. It is working terrific now. The quick checkout module is definetely an excellent module. Highly recommend it and your service. Cheers