The Thinkery

Not finding what you're looking for? Don't hesitate to contact us!

Before Posting...

Before posting questions in the forums, please be sure to read the FAQs by clicking on the FAQs link in the sidebar product menu. You must be logged in and have a valid subscription to access the SUPPORT FORUMS.
×
Support Policy Notice

As outlined in our Rules section (though never closely followed by our staff!), effective immediately we will no longer be taking time to provide customizations of our products.

QR Code on Property Flyer

  • dellison1226
  • dellison1226's Avatar Topic Author
  • Offline
  • Ponderer
  • Ponderer
More
8 years 9 months ago #27437 by dellison1226
dellison1226 created the topic: QR Code on Property Flyer
I am interested in adding a QR Code on the property flyer that will allow users with a mobile phone to scan and redirect to listing page. Most QR generators provide a embed code and the only thing that changes in the code is the url.

If I am correct IP uses the format: www.yourdomainname.com/real-estate?view=property&id= (some number is placed here for the listing)


Is there a way using php to insert the property id in the code from the property flyer? I have created a custom print.php that is working correct just need the listing id to insert in the QR generator code.

I tried to use <?php echo $this->p->id; ?>

Example:
<img src="http://qrfree.kaywa.com/?l=1&s=8&d=http%3A%2F%2Fwww.yourdomainname.com%2Freal-estate%3Fview%3Dproperty%26id%3D<?php echo $this->p->id; ?>" alt="QRCode"/>

Please Log in or Create an account to join the conversation.

More
8 years 9 months ago #27438 by tim
tim replied the topic: Re: QR Code on Property Flyer
If you created a custom print.php, then it depends what's being passed to that view. I'd var_dump($this->p) to see what you have there.

If you're just using the standard default.php view and modifying that for print, then yes, you should be able to use $this->p->id.

Are you seeing any errors in your PHP error log?

Please Log in or Create an account to join the conversation.

  • dellison1226
  • dellison1226's Avatar Topic Author
  • Offline
  • Ponderer
  • Ponderer
More
8 years 9 months ago #27439 by dellison1226
dellison1226 replied the topic: Re: QR Code on Property Flyer
Actually if I post the code like this:
$sidecol    .= '<?php echo $this->p->id; ?>';

The id does show up on the page. I guess the problem I am having is inserting the id within a url.

Like this: (the id of the listing should show up after %3D)
<img src="http://qrfree.kaywa.com/?l=1&s=8&d=http%3A%2F%2Fwww.yourdomainname.com%2Freal-estate%3Fview%3Dproperty%26id%3D<?php echo $this->p->id; ?>" alt="QRCode"/>

Of course the QR Code shows up but when I check the url it displays it exactly as I have it.

Please Log in or Create an account to join the conversation.

More
8 years 9 months ago #27440 by tim
tim replied the topic: Re: QR Code on Property Flyer
it's hard to say without seeing the code in context.

I'd guess you need to take a look at where that code block is since it's clearly not being interpreted by PHP-- so it's possibly surrounded by single quotes, etc.

Please Log in or Create an account to join the conversation.

  • dellison1226
  • dellison1226's Avatar Topic Author
  • Offline
  • Ponderer
  • Ponderer
More
8 years 9 months ago #27441 by dellison1226
dellison1226 replied the topic: Re: QR Code on Property Flyer
This is the actual code I am trying to get to work
$sidecol	.='<br /><img src="http://qrfree.kaywa.com/?l=1&s=8&d=http%3A%2F%2Fwww.yourdomainname.com%2Freal-estate%3Fview%3Dproperty%26id%3D<?php echo $this->p->id; ?>" alt="QRCode"/>';


Where this <?php echo $this->p->id; ?> should = id #

Please Log in or Create an account to join the conversation.

More
8 years 9 months ago #27442 by tim
tim replied the topic: Re: QR Code on Property Flyer
No, you need to do it like this:
$sidecol .='...property%26id%3D'.$this->p->id.'" alt="QRCode"/>';

You can see I snipped a bunch of code out to make it more clear. . .

Please Log in or Create an account to join the conversation.

Time to create page: 0.364 seconds