PDA

View Full Version : Plan Pricing is deleting the last 0 ? how to fix



Pete Young
October 14, 2014, 10:44 AM
using the modern blue template / when i add a price to a plan in the admin panel ? ex 1.50 the panel the auto deletes the 0 and makes it 1.5 > this is also repliacted in the public display the user see's when deciding on a plan as 1.5

how do i edit this to show correct as $1.50 or 1.50

thanks
pete

Curtis
October 14, 2014, 11:35 AM
using the modern blue template / when i add a price to a plan in the admin panel ? ex 1.50 the panel the auto deletes the 0 and makes it 1.5 > this is also repliacted in the public display the user see's when deciding on a plan as 1.5

how do i edit this to show correct as $1.50 or 1.50

thanks
pete

Hello Pete,

You can try make the following:

1. find file /admin/controller/listing_plans.inc.php (~330)


$data = array(
'Key' => $f_key,
'Type' => $f_type,
'Category_ID' => implode(',', $_POST['categories']),
'Allow_for' => implode(',', $_POST['account_type']),
'Limit' => $f_type != 'package' ? (int)$_POST['limit'] : '',
'Cross' => (int)$_POST['cross'],
'Color' => $_POST['color'],
'Price' => (double)$_POST['price'],
'Listing_period' => (int)$_POST['listing_period'],
'Plan_period' => (int)$_POST['plan_period'],
'Image' => (int)$_POST['images'],
'Image_unlim' => (int)$_POST['images_unlimited'],
'Video' => (int)$_POST['video'],
'Video_unlim' => (int)$_POST['video_unlimited'],
'Status' => $_POST['status'],
'Position' => $position['max']+1,
'Sticky' => empty($_POST['show_on_all']) ? 0 : 1,
'Subcategories' => empty($_POST['subcategories']) ? 0 : 1,
'Featured' => (int)$_POST['featured'],
'Advanced_mode' => $_POST['featured'] ? (int)$_POST['advanced_mode'] : 0,
'Standard_listings' => (int)$_POST['fa_standard'],
'Featured_listings' => (int)$_POST['fa_featured']
);


2. and replace to:



$data = array(
'Key' => $f_key,
'Type' => $f_type,
'Category_ID' => implode(',', $_POST['categories']),
'Allow_for' => implode(',', $_POST['account_type']),
'Limit' => $f_type != 'package' ? (int)$_POST['limit'] : '',
'Cross' => (int)$_POST['cross'],
'Color' => $_POST['color'],
'Price' => $_POST['price'],
'Listing_period' => (int)$_POST['listing_period'],
'Plan_period' => (int)$_POST['plan_period'],
'Image' => (int)$_POST['images'],
'Image_unlim' => (int)$_POST['images_unlimited'],
'Video' => (int)$_POST['video'],
'Video_unlim' => (int)$_POST['video_unlimited'],
'Status' => $_POST['status'],
'Position' => $position['max']+1,
'Sticky' => empty($_POST['show_on_all']) ? 0 : 1,
'Subcategories' => empty($_POST['subcategories']) ? 0 : 1,
'Featured' => (int)$_POST['featured'],
'Advanced_mode' => $_POST['featured'] ? (int)$_POST['advanced_mode'] : 0,
'Standard_listings' => (int)$_POST['fa_standard'],
'Featured_listings' => (int)$_POST['fa_featured']
);


3. and find row (~402)



$update_date = array(
'fields' => array(
'Status' => $_POST['status'],
'Type' => $f_type,
'Category_ID' => implode(',', $_POST['categories']),
'Allow_for' => implode(',', $_POST['account_type']),
'Limit' => $f_type != 'package' ? (int)$_POST['limit'] : '',
'Cross' => (int)$_POST['cross'],
'Color' => $_POST['color'],
'Price' => (double)$_POST['price'],
'Listing_period' => (int)$_POST['listing_period'],
'Plan_period' => (int)$_POST['plan_period'],
'Image' => (int)$_POST['images'],
'Image_unlim' => (int)$_POST['images_unlimited'],
'Video' => (int)$_POST['video'],
'Video_unlim' => (int)$_POST['video_unlimited'],
'Sticky' => empty($_POST['show_on_all']) ? 0 : 1,
'Subcategories' => empty($_POST['subcategories']) ? 0 : 1,
'Featured' => (int)$_POST['featured'],
'Advanced_mode' => $_POST['featured'] ? (int)$_POST['advanced_mode'] : 0,
'Standard_listings' => (int)$_POST['fa_standard'],
'Featured_listings' => (int)$_POST['fa_featured']
),
'where' => array( 'Key' => $f_key )
);


4. and replace to:



$update_date = array(
'fields' => array(
'Status' => $_POST['status'],
'Type' => $f_type,
'Category_ID' => implode(',', $_POST['categories']),
'Allow_for' => implode(',', $_POST['account_type']),
'Limit' => $f_type != 'package' ? (int)$_POST['limit'] : '',
'Cross' => (int)$_POST['cross'],
'Color' => $_POST['color'],
'Price' => $_POST['price'],
'Listing_period' => (int)$_POST['listing_period'],
'Plan_period' => (int)$_POST['plan_period'],
'Image' => (int)$_POST['images'],
'Image_unlim' => (int)$_POST['images_unlimited'],
'Video' => (int)$_POST['video'],
'Video_unlim' => (int)$_POST['video_unlimited'],
'Sticky' => empty($_POST['show_on_all']) ? 0 : 1,
'Subcategories' => empty($_POST['subcategories']) ? 0 : 1,
'Featured' => (int)$_POST['featured'],
'Advanced_mode' => $_POST['featured'] ? (int)$_POST['advanced_mode'] : 0,
'Standard_listings' => (int)$_POST['fa_standard'],
'Featured_listings' => (int)$_POST['fa_featured']
),
'where' => array( 'Key' => $f_key )
);

Pete Young
October 14, 2014, 02:17 PM
? Hello Curtis I edited the changed line 'Price' => (double)$_POST['price'], to 'Price' => $_POST['price'], and nothing happened still stayed the same ?

Curtis
October 15, 2014, 03:17 AM
? Hello Curtis I edited the changed line 'Price' => (double)$_POST['price'], to 'Price' => $_POST['price'], and nothing happened still stayed the same ?

Hm, can you give me access to your site for checking of it?
May be the problem in the frontend only.

Curtis
October 15, 2014, 06:18 AM
Hi Pete,

I've changed the type of field from float to varchar (255) also in the database.
You can check it again.

Pete Young
October 15, 2014, 09:56 AM
Thanks Curtis that fixed things, appreciated
Pete