*

BabyDunk

  • ****
  • 161 posts
[Help] Favorite button in item.php
« on: August 14, 2016, 12:30:07 AM »
Quote
Make Favorite button
This code must be entere inside item loop. That means it needs to be placed inside loop starting with while(osc_has_items()){ or while(osc_has_items()){ or while(osc_has_custom_items()){
<?php echo fi_make_favorite(); ?>

Note that you can use this function also outside item loop, but in this case you need to enter (optional) parameter with ID of listing. So i.e. if you want to make button for listing id = 95, you will call this function like fi_make_favorite(95)

i have a question about placing the fi_make_favorite() button in the item.php

have the fi_make_favorite() placed and it seems to be working 100% but you say that if the fi_make_favorite() is not placed inside one of the loops listed then there would need to be an id linked to fi_make_favorite()

this is how i have placed the make button on item.php
Code: [Select]
<?php if( osc_price_enabled_at_items() ) { ?>
          <div class="price">
            <span class="lead"><?php _e('Price''patricia'); ?></span>
            <span class="value"><?php echo osc_item_formated_price(); ?></span>
          <div class="favstar">
            <span><?php if(function_exists('fi_make_favorite')) { echo fi_make_favorite(); } ?><?php _e('Love this'?></span>
            </div>
          </div>
        <?php ?>

is there anything i need to change in this ?? i dont see any probs when selecting a listing to favorites. just wanting to verify i have this done correctly :D

Thanks
Chris
I Am A Noob But I Am Here To Learn.
Please be patient ;) ;D

*

MB Themes

Re: [Help] Favorite button in item.php
« Reply #1 on: August 14, 2016, 09:37:54 AM »
@BabyDunk
Reason why code should be placed in while loop is to have osc_item_id() function available.
However in item.php, this function works in any part of code so nothing special is required there.
Your function looks to be correct.
Make sure star is not hidden somewhere over block.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

BabyDunk

  • ****
  • 161 posts
Re: [Help] Favorite button in item.php
« Reply #2 on: August 14, 2016, 12:42:54 PM »
Thanks for looking over that for me.

i was thinking that was the case and thanks for the heads up on the hidden block.  it was hiding at the 350px when the price was set to a 1000000.00 (doubt i will ever get a listing at that price lol ) but a clear:both  sorted that :D

thanks again
I Am A Noob But I Am Here To Learn.
Please be patient ;) ;D

*

MB Themes

Re: [Help] Favorite button in item.php
« Reply #3 on: August 14, 2016, 01:50:50 PM »
@BabyDunk
Cool, welcome ;)
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots