*

Loma

  • ***
  • 69 posts
  • Loma
custom add cart button like osclasspoint.com
« on: November 17, 2017, 03:42:08 AM »
i like add cart button in osclasspoint.com

how can i add it

*

MB Themes

Re: custom add cart button like osclasspoint.com
« Reply #1 on: November 17, 2017, 10:53:43 AM »
@Loma
You can inspect styles in browser and copy it, but please do not use exactly same colors  ;)
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

russia

  • **
  • 15 posts
Re: custom add cart button like osclasspoint.com
« Reply #2 on: November 18, 2017, 03:31:28 PM »
hello frosticek,
how are you doing  :)

it is possible to do that if you will clarify,
<a class="cart-button btn btn-primary tr1 round3 i-shadow" href=????

what we will put after href,

*

MB Themes

Re: custom add cart button like osclasspoint.com
« Reply #3 on: November 18, 2017, 07:23:02 PM »
@russia
It's standard add-to-cart link, it's listed in plugin configuration. (isn't it?)
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

russia

  • **
  • 15 posts
Re: custom add cart button like osclasspoint.com
« Reply #4 on: November 18, 2017, 08:13:46 PM »
yes  listed in plugin configuration.

but unfortunately,
after modifying that code's css,  everything will get unorganised, like button on search,hom  etc
you knows what i mean.  :D   


please provide working code, :)

*

MB Themes

Re: custom add cart button like osclasspoint.com
« Reply #5 on: November 18, 2017, 08:27:33 PM »
Its probably function osp_cart_add. I do not have code as everything is done on demand to fit all requirements of market.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

Loma

  • ***
  • 69 posts
  • Loma
Re: custom add cart button like osclasspoint.com (solved)
« Reply #6 on: November 19, 2017, 03:37:57 AM »
@russia

in function.php find
function osp_product_to_cart_link($item_id = -1, $quantity = 1, $is_hook = 0)

and add this code to the top of it


function osp_product_to_cart_link_custom($item_id = -1, $quantity = 1, $is_hook = 0) {
  $sellers = explode(',', osp_param('seller_users'));
  $html = '';

  if($item_id == -1) {
    $item_id = osc_item_id();
  }

  if(osp_param('selling_allow') == 1 && $item_id <> '' && $item_id > 0) {
    $item = Item::newInstance()->findByPrimaryKey($item_id);
    $data = ModelOSP::newInstance()->getItemData($item_id);
    $qty = @$data['i_quantity'] > 0 ? @$data['i_quantity'] : 0;
    $title = '';

    if(@$data['i_sell'] == 1 && (in_array($item['fk_i_user_id'], $sellers) || osp_param('seller_all') == 1)) {
      if($item['i_price'] <> '' && $item['i_price'] > 0) {
   
        if(($qty <= 0 && osp_param('stock_management') == 0) || ($item['fk_i_user_id'] == osc_logged_user_id() && osc_is_web_user_logged_in())) {
          if($item['fk_i_user_id'] == osc_logged_user_id() && osc_is_web_user_logged_in()) {
            $title = osc_esc_html(__('This is your product, you cannot buy it!', 'osclass_pay'));
          }

          $html .= '<a class="cart-button btn btn-primary tr1 round3 i-shadow osp-disabled osp-has-tooltip" title="' . $title . '" href="#" onclick="return false;"><i class="fa fa-shopping-basket"></i><span class="top"> ' . __('Add to cart', 'osclass_pay') . '</span>';
        } else {
          $html .= '<a class="cart-button btn btn-primary tr1 round3 i-shadow" href="' . osp_cart_add(OSP_TYPE_PRODUCT, $quantity, $item['pk_i_id'], round(osp_convert($item['i_price']/1000000, $item['fk_c_currency_code']), 2)) . '"><i class="fa fa-shopping-basket"></i><span class="top">' . __('Add to cart', 'osclass_pay') . '</span>';
        }

        if(osp_param('stock_management') == 1 && osp_param('quantity_show') == 1) {
          if($qty > 0) {
            $html .= '<span class="bot">' . __('Available', 'osclass_pay') . ': <strong>' . $qty . 'x</strong> </span></a>';
          } else {
            $html .= '<span class="bot osp-disabled">>' . __('Sold out!', 'osclass_pay') . '</span></a>';
          }
        }

      }
    }
  }

  return $html;
}

 and then copy css from osclasspoint.com or custom like you want