PDA

View Full Version : Flatty template - make other type than price to show on top with special decoration



Wei Hong
April 1, 2015, 10:39 AM
Dear Flynax Developer,

I'm using general flatty template.
Please look at the screenshot 1, it is the default showing of listing field type: 'price'


I have another listing field (mixed type) with key: "rentalrate," please look at screenshot 2. This listing field is served as a price as well, but a mixed type.



Would you please help me to include that listing field: "rentalrate" to show on top and big, similar text decoration just like the price in screenshot 1.

Similarly in listing carousel:



Thank you

Pete Young
April 1, 2015, 01:40 PM
Have a look in your category / build forms / short form and you should see price in there so just drag and drop the new one over as well ? not sure if its that or the image is from the featured form ? if so then check that one / all should be good

Wei Hong
April 1, 2015, 02:42 PM
it doesn't work Pete, as I stated above, the looks only work for 'price' key, and it is preset. No matter what order in your short form. It only work for the listing field which has key: 'price'
I need to add another listing field key beside 'price', which is 'rentalrate' in my case

Curtis
April 2, 2015, 08:47 AM
Hello Wei Hong,

You can make the following to change the price field to your custom field:
1. open file >>your_template/tpl/blocks/listing.tpl
2. find row (~29):


{assign var='price_value' value=''}{foreach from=$listing.fields item='item' key='field' name='fListings'} {if !empty($item.value) && $item.Details_page && $item.Key|strpos:'price' !== false} <div class="price-tag">{$item.value}</div> {assign var='price_value' value=$item.value} {break} {/if}{/foreach}
ad replace it:


{assign var='price_value' value=''}{foreach from=$listing.fields item='item' key='field' name='fListings'} {if !empty($item.value) && $item.Details_page && $item.Key|strpos:'rentalrate' !== false} <div class="price-tag">{$item.value}</div> {assign var='price_value' value=$item.value} {break} {/if}{/foreach}
3. find row (~50)


{if !empty($item.value) && $item.Details_page && $item.Key|strpos:'price' === false}

and replace to:


{if !empty($item.value) && $item.Details_page && $item.Key|strpos:'rentalrate' === false}

Wei Hong
April 2, 2015, 09:26 AM
Hello Wei Hong,

You can make the following to change the price field to your custom field:
1. open file >>your_template/tpl/blocks/listing.tpl
2. find row (~29):


{assign var='price_value' value=''}{foreach from=$listing.fields item='item' key='field' name='fListings'} {if !empty($item.value) && $item.Details_page && $item.Key|strpos:'price' !== false} <div class="price-tag">{$item.value}</div> {assign var='price_value' value=$item.value} {break} {/if}{/foreach}
ad replace it:


{assign var='price_value' value=''}{foreach from=$listing.fields item='item' key='field' name='fListings'} {if !empty($item.value) && $item.Details_page && $item.Key|strpos:'rentalrate' !== false} <div class="price-tag">{$item.value}</div> {assign var='price_value' value=$item.value} {break} {/if}{/foreach}
3. find row (~50)


{if !empty($item.value) && $item.Details_page && $item.Key|strpos:'price' === false}

and replace to:


{if !empty($item.value) && $item.Details_page && $item.Key|strpos:'rentalrate' === false}



Hi Curtis, thank you for your suggestion. But this method will replace the 'price' key with 'rentalrate' key. I actually want the format to stay with 'price', and in addition to 'rentalrate' key. If I do as your suggestion, the 'price' listing field key will lose its format.

Curtis
April 2, 2015, 11:48 AM
Hi Curtis, thank you for your suggestion. But this method will replace the 'price' key with 'rentalrate' key. I actually want the format to stay with 'price', and in addition to 'rentalrate' key. If I do as your suggestion, the 'price' listing field key will lose its format.

Hmm. Do you want add your custom field together with a price field?
Give me more details about it and draw a screen with example.

Wei Hong
April 2, 2015, 02:19 PM
Hmm. Do you want add your custom field together with a price field?
Give me more details about it and draw a screen with example.

Hi Curtis, I want the listing field "rentalrate" to have the same display format as "price" field. Both of them with same display format.

I have explained everything with screenshot in post 1
Here it is:

Please look at the screenshot 1, it is the default showing of listing field type: 'price'
1250

I have another listing field (mixed type) with key: "rentalrate," please look at screenshot 2. This listing field is served as a price as well, but a mixed type.

1249

Would you please help me to include that listing field: "rentalrate" to show on top and big, similar text decoration just like the price in screenshot 1.

Similarly in listing carousel:

1248

I want the "rentalrate" to have the same decoration as "price"

Curtis
April 3, 2015, 06:37 AM
Hello Wei Hong,

OK. Our developer return to you as soon, please wait.

Wei Hong
April 3, 2015, 07:24 AM
Hello Wei Hong,

OK. Our developer return to you as soon, please wait.

Excellent, I'm looking forward to the change. Thank you

Wei Hong
April 8, 2015, 03:41 PM
Hello Wei Hong,

OK. Our developer return to you as soon, please wait.

Hi Curtis, so a developer is helping me on this request and from what I see, it's a css custom change, which is not perfect, since you have to change it in several places. Then same with the listing carousel, you need to make change there also.

My question is, is there anyway if you could use a code function as "and" command, to add listing field 'rentalrate' and 'price' to have that display format and setting?

For example you add this code earlier:


{assign var='price_value' value=''}{foreach from=$listing.fields item='item' key='field' name='fListings'} {if !empty($item.value) && $item.Details_page && $item.Key|strpos:'rentalrate' !== false} <div class="price-tag">{$item.value}</div> {assign var='price_value' value=$item.value} {break} {/if}{/foreach}

Is there anyway if I could do this:


{assign var='price_value' value=''}{foreach from=$listing.fields item='item' key='field' name='fListings'} {if !empty($item.value) && $item.Details_page && $item.Key|strpos:'rentalrate' and&& 'price' !== false} <div class="price-tag">{$item.value}</div> {assign var='price_value' value=$item.value} {break} {/if}{/foreach}

Curtis
April 9, 2015, 03:18 AM
Hi Curtis, so a developer is helping me on this request and from what I see, it's a css custom change, which is not perfect, since you have to change it in several places. Then same with the listing carousel, you need to make change there also.

My question is, is there anyway if you could use a code function as "and" command, to add listing field 'rentalrate' and 'price' to have that display format and setting?

For example you add this code earlier:



Is there anyway if I could do this:

Hi Wei Hong,

I understand you, but it's not possible, because these variables must be counted separately only.