Item Reserved
« on: February 02, 2024, 03:11:49 PM »
Is it possible that you could create a function to deactivate the item or to make it look like the item is reserved?

Of course you should be able to set it back to active if the customer doesn't buy.

Maybe someone has an idea.

I would have the solution, but it shouldn't be two buttons, but rather everything in one.



item.php
Code: [Select]
<strong>
            <a href="<?php echo osc_item_deactivate_url(); ?>" rel="nofollow"><button><?php _e('Deactivate''sigma'); ?></button></a>
        </strong><br>
         
          <strong>   
            <a href="<?php echo osc_item_activate_url(); ?>" rel="nofollow"><button><?php _e('Activate''sigma'); ?></button></a>
        </strong>


Thank you in advance for tips and help.



« Last Edit: February 02, 2024, 05:06:24 PM by Roberto Klapper »

Re: Item Reserved
« Reply #1 on: February 17, 2024, 11:16:10 AM »
How could you do this so that the item is not completely deactivated, so that it can still be seen in the lite but the images are timed and resaved can be seen as text.

Marked as best answer by Roberto Klapper on February 19, 2024, 03:36:13 PM
*

MB Themes

Re: Item Reserved
« Reply #2 on: February 18, 2024, 12:57:33 PM »
You could use attributes plugin or custom function instead, but here talking about something very specific for your business
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

Re: Item Reserved
« Reply #3 on: February 19, 2024, 03:37:01 PM »
It would be great if something like this could be installed in the future.

Re: Item Reserved
« Reply #4 on: February 22, 2024, 11:54:12 AM »
So as it is, it doesn't work for me with Sigma Theme, now my question is how do I adapt it to sigma? Does anyone have an idea or solution?


item.php

Code: [Select]
<?php 
                  
if (osc_rewrite_enabled()) { 
                    if( 
$item_extra['i_sold'] == ) {
                      
$sold_url '?itemId=' osc_item_id() . '&markSold=1&secret=' osc_item_field('s_secret') . '&itemType=active';
                      
$reserved_url '?itemId=' osc_item_id() . '&markSold=2&secret=' osc_item_field('s_secret') . '&itemType=active';
                    } else {
                      
$sold_url '?itemId=' osc_item_id() . '&markSold=0&secret=' osc_item_field('s_secret') . '&itemType=active';
                      
$reserved_url '?itemId=' osc_item_id() . '&markSold=0&secret=' osc_item_field('s_secret') . '&itemType=active';
                    }
                  } else {
                    if( 
$item_extra['i_sold'] == ) {
                      
$sold_url '&itemId=' osc_item_id() . '&markSold=1&secret=' osc_item_field('s_secret') . '&itemType=active';
                      
$reserved_url '&itemId=' osc_item_id() . '&markSold=2&secret=' osc_item_field('s_secret') . '&itemType=active';
                    } else {
                      
$sold_url '&itemId=' osc_item_id() . '&markSold=0&secret=' osc_item_field('s_secret') . '&itemType=active';
                      
$reserved_url '&itemId=' osc_item_id() . '&markSold=0&secret=' osc_item_field('s_secret') . '&itemType=active';
                    }
                  }
                
?>



                <?php if(!in_array(osc_item_category_id(), sigma_extra_fields_hide())) { ?>
                  <a target="_blank" class="tr1 round2 sold" href="<?php echo osc_user_list_items_url() . $sold_url?>"><i class="fa fa-gavel"></i> <span><?php echo ($item_extra['i_sold'] == __('Not sold''sigma') : __('Sold''sigma')); ?></span></a>
                  <a target="_blank" class="tr1 round2 reserved" href="<?php echo osc_user_list_items_url() . $reserved_url?>"><i class="fa fa-flag-o"></i> <span><?php echo ($item_extra['i_sold'] == __('Unreserve''sigma') : __('Reserved''sigma')); ?></span></a>
                <?php ?>
              </div>
            <?php ?>

<div class="labels">
            <?php if($item_extra['i_sold'] == 1) { ?>
              <div class="elem sold"><i class="fa fa-gavel"></i> <?php _e('Sold''sigma'); ?></div>
            <?php } else if($item_extra['i_sold'] == 2) { ?>
              <div class="elem reserved"><i class="fa fa-flag"></i> <?php _e('Reserved''sigma'); ?></div>
            <?php ?>

user-items.php

Code: [Select]
<?php if(osc_item_is_inactive()) {?>
                    <a class="activate round2 tr1" href="<?php echo osc_item_activate_url(); ?>"><?php _e('Validate''sigma'); ?></a>
                  <?php } else { ?>
                    <?php 
                      
if (osc_rewrite_enabled()) { 
                        if( 
$item_extra['i_sold'] == ) {
                          
$sold_url '?itemId=' osc_item_id() . '&markSold=1&secret=' osc_item_field('s_secret') . '&itemType=' $item_type;
                          
$reserved_url '?itemId=' osc_item_id() . '&markSold=2&secret=' osc_item_field('s_secret') . '&itemType=' $item_type;
                        } else {
                          
$sold_url '?itemId=' osc_item_id() . '&markSold=0&secret=' osc_item_field('s_secret') . '&itemType=' $item_type;
                          
$reserved_url '?itemId=' osc_item_id() . '&markSold=0&secret=' osc_item_field('s_secret') . '&itemType=' $item_type;
                        }
                      } else {
                        if( 
$item_extra['i_sold'] == ) {
                          
$sold_url '&itemId=' osc_item_id() . '&markSold=1&secret=' osc_item_field('s_secret') . '&itemType=' $item_type;
                          
$reserved_url '&itemId=' osc_item_id() . '&markSold=2&secret=' osc_item_field('s_secret') . '&itemType=' $item_type;
                        } else {
                          
$sold_url '&itemId=' osc_item_id() . '&markSold=0&secret=' osc_item_field('s_secret') . '&itemType=' $item_type;
                          
$reserved_url '&itemId=' osc_item_id() . '&markSold=0&secret=' osc_item_field('s_secret') . '&itemType=' $item_type;
                        }
                      }
                    
?>


                    <?php if(!in_array(osc_item_category_id(), sigma_extra_fields_hide())) { ?>
                      <a class="sold round2 tr1" href="<?php echo osc_user_list_items_url() . $sold_url?>"><?php echo ($item_extra['i_sold'] == __('Unmark as sold''sigma') : __('Mark as sold''sigma')); ?></a>
                      <a class="reserved round2 tr1" href="<?php echo osc_user_list_items_url() . $reserved_url?>"><?php echo ($item_extra['i_sold'] == __('Cancel reservation''stela') : __('Reserve''sigma')); ?></a>
                    <?php ?> 


<div class="category round2"><i class="fa fa-cog"></i> <?php echo osc_item_category(); ?></div>

                  <?php if($item_extra['i_sold'] == 1) { ?>
                    <div><?php _e('Sold!''sigma'); ?></div>
                  <?php } else if($item_extra['i_sold'] == 2) { ?>
                    <div><?php _e('Reserved!''sigma'); ?></div>
                  <?php ?>

loop-single.php

Code: [Select]
<?php } else if($item_extra['i_sold'] == 2) { ?>
          <a class="reserved-label label" href="<?php echo osc_item_url(); ?>">
            <span><?php _e('reserved''sigma'); ?></span>
          </a>
        <?php ?>

style.css

Code: [Select]
#images .flag.reserved {background: #EDD840;color:#333;}
#images .flag.reserved:after {border-color: transparent transparent transparent #EDD840;}
#images .flag.reserved:before {border-color: #ccba37 #ccba37 transparent transparent;}

#listing .labels .elem.reserved {background:#EDD840;color:#333;}

.white .labels > a.reserved-label {background:#EDD840;color:#333;}
« Last Edit: February 22, 2024, 11:57:48 AM by Roberto Klapper »

*

MB Themes

Re: Item Reserved
« Reply #5 on: February 22, 2024, 02:01:00 PM »
Sigma theme does not recognize "item_extra" table.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

Re: Item Reserved
« Reply #6 on: February 22, 2024, 05:52:32 PM »
What could you do instead of item_extra? or create this table?

*

MB Themes

Re: Item Reserved
« Reply #7 on: February 23, 2024, 02:45:05 PM »
you need to create table and functions those provide read, insert & update access to table.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

Re: Item Reserved
« Reply #8 on: February 23, 2024, 04:27:02 PM »
But you could add a small element above the photo where it says Reserved, and in my account there is a button that then marks the photo as Reserved, now the whole thing has to stay saved like that, so I have to create a table or not ?