68 Classifieds Forums

Price checking by Listing Package

This is a discussion on Price checking by Listing Package within the v3.0 Questions & Support forums, part of the v3.0.x Help & Support category; O.k. My client has adjusted his plan and will now be offering only one package per price range. So it ...


Go Back   68 Classifieds Forums > Archives > v3.0.x Help & Support > v3.0 Questions & Support

 
 
LinkBack Thread Tools Display Modes
  #11  
Old 08-01-2006, 10:49 PM
Member
 
Join Date: Jun 2006
Posts: 59
Rep Power: 12
e1m2j is on a distinguished road
Default

O.k. My client has adjusted his plan and will now be offering only one package per price range. So it looks like I have a solution.

Many Thanks.

A side topic:
Is there a way to have the customer put his price in before selecting a package? Then the package could be automatically selected (as there's only one per price range) and that price field passed into the form where they fill out details.
  #12  
Old 08-01-2006, 11:25 PM
Member
 
Join Date: Jun 2006
Posts: 59
Rep Power: 12
e1m2j is on a distinguished road
Default Aaaaaaaaaaaaaaaaaa

So, I updated the code (below) in usercheckout.php and it doesn't give an error, but it also doesn't put people into the right package. Even with the new code in usercheckout.php I successfully placed an ad in a package that was not correct for the item price. Thoughts?

PHP Code:
//submit the details.
            
if(isset($_POST['title']) && isset($_POST['section']))
            {
                
$section=(int)@$_POST['section'];
                
$productid=(int)@$_POST['productid'];
                
$title=@$_POST['title'];
                
$listingprice=0;
                if(isset(
$_POST['price']) && $_POST['price']<>"")
                {
                    
$listingprice=@trim($_POST['price']);
                }
                
$url=@$_POST['url'];
                
$shortdescription=@$_POST['shortdescription'];
                
$description=@$_POST['description'];
                
$featured=@$_POST['featured'];
                
$bold=@$_POST['bold'];
                
$highlighted=@$_POST['highlighted'];
                
$provider=@$_POST['provider'];
                
$pPrice=0;
                
$boldPrice=0;
                
$highlightedPrice=0;
                
$discountText="";

                
//Replace harmful scripts, badwords and links.
                
$title filterword($title);
                
$number=explode("."$listingprice);
                if(
strlen($number[1])==|| strlen($number[1])==2)
                {
                    
//american
                    
$listingprice=str_replace(","""$listingprice);
                    
$listingprice=ereg_replace("[^.[:alnum:]]","",$listingprice);
                    
//new code

if($listingprice <= '40.00')
{
$package=2;
}
elseif((
$listingprice '40.00') && ($listingprice <= '70.00'))
{
$package=3;
}
elseif((
$listingprice '70.00') && ($listingprice <= '100'))
{
$package=4;

elseif((
$listingprice '100.00') && ($listingprice <= '1000'))
{
$package=5;

elseif(
$listingprice '1000.00')
{
$package=6;
}                 

//end new code

}
                else
                {
                    
//something else
                    
$listingprice=str_replace(".","",$listingprice);
                    
$listingprice=str_replace(",",".",$listingprice);
                    
$listingprice=ereg_replace("[^.[:alnum:]]","",$listingprice);
                }
                
$shortdescription filterword($shortdescription);
                
$shortdescription strip_tags($shortdescription,'<br>');
                
$shortdescription eregi_replace("<script[^>]*>.*</script>"," ",$shortdescription);
                
$shortdescription ereg_replace("[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]"," "$shortdescription);
                
$shortdescription ereg_replace("(\r\n|\n|\r)""<br />"$shortdescription);

                
$description filterword($description);
                
$description strip_tags($description,'<br>');
                
$description eregi_replace("<script[^>]*>.*</script>"," ",$description);
                
$description ereg_replace("[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]"," "$description);
                
$description ereg_replace("(\r\n|\n|\r)""<br />"$description);
                
                
//find out which ad was selected 
  #13  
Old 08-02-2006, 11:35 PM
Member
 
Join Date: Jun 2006
Posts: 59
Rep Power: 12
e1m2j is on a distinguished road
Default

Any ideas. I thought this would work, but it doesn't. And I've got an client who wants to launch his site with this scinario.

Thanks.
  #14  
Old 08-03-2006, 05:19 PM
Member
 
Join Date: Jun 2006
Posts: 59
Rep Power: 12
e1m2j is on a distinguished road
Default

help

me

please

Last edited by e1m2j; 08-03-2006 at 05:51 PM.
  #15  
Old 08-03-2006, 06:24 PM
Eric Barnes's Avatar
68 Classifieds Staff
 
Join Date: Mar 2006
Location: Belmont, NC
Posts: 4,307
Rep Power: 99
Eric Barnes is a jewel in the rough
Default

Try this:

PHP Code:
//new code 
echo "Listing Price: "$listingprice ."<br />Package: "$package;
if(
$listingprice <= '40.00'

$package=2

elseif((
$listingprice '40.00') && ($listingprice <= '70.00')) 

$package=3

elseif((
$listingprice '70.00') && ($listingprice <= '100')) 

$package=4
}  
elseif((
$listingprice '100.00') && ($listingprice <= '1000')) 

$package=5
}  
elseif(
$listingprice '1000.00'

$package=6
}                  
echo 
"<br /> New Package: "$package;
//end new code 
All that ads is some echo statements which will print the values at the top of the page. Once you have added those run a test then report back with what is printed.
__________________
Eric Barnes
68 Classifieds Developer
Please do not send me a private message asking for support. Instead use these open forums or our ticket system.

Customer Area | Issue Tracker | Documentation | 68C Mods | Submit a Ticket | Twitter
  #16  
Old 08-03-2006, 11:34 PM
Member
 
Join Date: Jun 2006
Posts: 59
Rep Power: 12
e1m2j is on a distinguished road
Default

When I replace what I had with what you suggested I get:

Listing Price: 1230
Package:
New Package: 6

I had selected package 2 which was to be $40-$70. So it does appear to recognizing the new package (even if it doesn't list the selected package in the Package: space - is it supposed to)

However, when I continue on I'm only being charged the package 3 price not the package 6 price.
  #17  
Old 08-07-2006, 10:41 AM
Member
 
Join Date: Jun 2006
Posts: 59
Rep Power: 12
e1m2j is on a distinguished road
Exclamation

Any thoughts Eric/others?

Seems that it's recognizing the switch, but not passing the new value through the rest of the checkout process.
  #18  
Old 08-08-2006, 01:22 PM
Member
 
Join Date: Jun 2006
Posts: 59
Rep Power: 12
e1m2j is on a distinguished road
Default

Any ideas? Anyone?
  #19  
Old 08-09-2006, 10:22 PM
juven14's Avatar
Moderator
 
Join Date: Mar 2006
Location: NJ/NYC Area
Posts: 2,132
Rep Power: 57
juven14 is a jewel in the rough
Send a message via Skype™ to juven14
Default

Try this:

Open usercheckout.php:

Scroll down to step 4 and find:

PHP Code:
$description ereg_replace("(\r\n|\n|\r)""<br />"$description); 
Add this just below it:

PHP Code:
//new code
//echo "Listing Price: ". $listingprice ."<br />Package: ". $productid;
if($listingprice <= '40.00')
{
    
$productid=2;
}
elseif((
$listingprice '40.00') && ($listingprice <= '70.00'))
{
    
$productid=3;
}
elseif((
$listingprice '70.00') && ($listingprice <= '100'))
{
    
$productid=4;
}  
elseif((
$listingprice '100.00') && ($listingprice <= '1000'))
{
    
$productid=5;
}  
elseif(
$listingprice '1000.00')
{
    
$productid=6;
}                  
//echo "<br /> New Package: ". $productid;
//end new code 
I basically commented out the lines that echo for testing, and I replaced $package with $productid.

The only thing that came to mind is that you'll need identical packages except for the price, since the features of the listing are defined by the original package chosen.
__________________
Regards,

John


“By perseverance, study, and eternal desire, any man can become great.” George S. Patton

Last edited by juven14; 08-09-2006 at 10:24 PM.
  #20  
Old 08-10-2006, 10:00 AM
Member
 
Join Date: Jun 2006
Posts: 59
Rep Power: 12
e1m2j is on a distinguished road
Default

Thanks, but that doesn't do it.

I tried it just like you described and it changed the package, but made it $0.

Then I tried reverted $productid to $package, and that let the transaction go through with a value, but the original value.

Perhaps I put your code in the wrong place. Step 4 wasn't very obvious to me in the code, but there was only one place where the line
$description = ereg_replace("(\r\n|\n|\r)", "<br />", $description);
exists.

Other thoughts?
 

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
MOD: Price Descriptor Chaslie v3.1 Modules & Modifications 7 02-27-2008 04:23 PM
User: See's Membership listing package garysr v3.1 Questions & Support 23 11-04-2006 02:08 PM
Listing package - 0.00 where I can delete this???? akm v3.1 Questions & Support 3 06-25-2006 09:30 PM
Delete Listing Package ... what happens to listings? hppenterprises v3.1 Questions & Support 2 06-02-2006 06:08 PM
Large price field entry causes listing to be hidden in admincp civ v3.0 Questions & Support 1 04-07-2006 11:04 AM


All times are GMT -4. The time now is 05:28 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22