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
<?php
if (osc_rewrite_enabled()) {
if( $item_extra['i_sold'] == 0 ) {
$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'] == 0 ) {
$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'] == 1 ? __('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'] == 2 ? __('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
<?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'] == 0 ) {
$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'] == 0 ) {
$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'] == 1 ? __('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'] == 2 ? __('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
<?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
#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;}