Advertisement:

Author Topic: BUG, price disable not working  (Read 5916 times)

searchweb

  • Jr. Member
  • **
  • Posts: 69
BUG, price disable not working
« on: April 24, 2014, 12:03:46 pm »
the price didn't disable when use option for disable price into certain category. It's still showing price input field. When changing the theme into bender, the price input field will disable, so i think it's bug from repurpose theme

I try in latest osclass and repurpose theme.

frosticek

  • Hero Member
  • *****
  • Posts: 3948
Re: BUG, price disable not working
« Reply #1 on: April 24, 2014, 12:58:20 pm »
@searchweb
Yes, there must be condition in theme to show/do not show price field based on this setting.
You can fix this in item-post.php and item-edit.php ;)

searchweb

  • Jr. Member
  • **
  • Posts: 69
Re: BUG, price disable not working
« Reply #2 on: April 24, 2014, 03:07:13 pm »
@frosticek any solution?
yes, seem the ajax for price hidden didn't working. The core function from osclass working well. The problem only with the theme. Seem the theme can't read the function. It's same with twitter theme, the price disable not working.
« Last Edit: April 24, 2014, 03:32:48 pm by searchweb »

frosticek

  • Hero Member
  • *****
  • Posts: 3948
Re: BUG, price disable not working
« Reply #3 on: April 24, 2014, 05:29:54 pm »
@searchweb
Well, those themes are not updated. You can check modern theme what is the solution for this or use modern/bender that are updated.

searchweb

  • Jr. Member
  • **
  • Posts: 69
Re: BUG, price disable not working
« Reply #4 on: April 24, 2014, 07:47:54 pm »
@frosticek

after check both of that theme, it's seem the main different is  if else checking for $("#price").blur(function(event) {

When adding that code into javascript in item post, it's seem nothing happen. The display:none didn't changing. Any solution? Thanks for your help.

frosticek

  • Hero Member
  • *****
  • Posts: 3948
Re: BUG, price disable not working
« Reply #5 on: April 24, 2014, 08:11:28 pm »
@searchweb
- first check if jquery is working on this site (no bugs & errors)
- then copy file from modern theme into your
- finally check if selectors has same id and class as is required in jquery

searchweb

  • Jr. Member
  • **
  • Posts: 69
Re: BUG, price disable not working
« Reply #6 on: April 24, 2014, 08:46:56 pm »
@frosticek

already check and make sure jquery working fine. Also copy the code from modern theme for checking and showing item prices. I also try to copy item-post from modern theme into repurpose, but it's also not working. Which function on jquery for checking disable price? In which js file for modern theme?

I try to find the function in every js files but can't find it. Looking for solution, please... Thanks.
« Last Edit: April 24, 2014, 08:48:53 pm by searchweb »

frosticek

  • Hero Member
  • *****
  • Posts: 3948
Re: BUG, price disable not working
« Reply #7 on: April 24, 2014, 09:05:31 pm »
@searchweb
I found this in item-post.php:
Code: [Select]
            $().ready(function(){
                $("#price").blur(function(event) {
                    var price = $("#price").prop("value");
                    <?php if(osc_locale_thousands_sep()!='') { ?>
                    while(price.indexOf('<?php echo osc_esc_js(osc_locale_thousands_sep());  ?>')!=-1) {
                        price = price.replace('<?php echo osc_esc_js(osc_locale_thousands_sep());  ?>', '');
                    }
                    <?php }; ?>
                    <?php if(osc_locale_dec_point()!='') { ?>
                    var tmp = price.split('<?php echo osc_esc_js(osc_locale_dec_point())?>');
                    if(tmp.length>2) {
                        price = tmp[0]+'<?php echo osc_esc_js(osc_locale_dec_point())?>'+tmp[1];
                    }
                    <?php }; ?>
                    $("#price").prop("value", price);
                });
            });

But this code has nothing with showing-hiding price filed

This is the right part of code:
Code: [Select]
                    <?php if( osc_price_enabled_at_items() ) { ?>
                    <div class="box price">
                        <label for="price"><?php _e('Price''modern'); ?></label>
                        <?php ItemForm::price_input_text(); ?>
                        <?php ItemForm::currency_select(); ?>
                    </div>
                    <?php ?>

But as you can here, this does not support allow/deny price based on category, only global on all listings

searchweb

  • Jr. Member
  • **
  • Posts: 69
Re: BUG, price disable not working
« Reply #8 on: April 24, 2014, 09:49:20 pm »
yes, it's true. I add both of that code and it's not working. Also try only copy paste the if else checking for price disable and the result is same, not working at all. I have make sure the category and sub category have uncheck in admin panel for price enable/disable. Not sure what happen, but it's not working at all. Any solution?

frosticek

  • Hero Member
  • *****
  • Posts: 3948
Re: BUG, price disable not working
« Reply #9 on: April 25, 2014, 12:16:30 am »
@searchweb
Maybe bender theme has this secret, will check tomorrow.

searchweb

  • Jr. Member
  • **
  • Posts: 69
Re: BUG, price disable not working
« Reply #10 on: April 25, 2014, 12:33:08 am »
@frosticek

Thanks. Wait for that. I have check in modern theme but can't find it. Anyway i have open the bug report into github. Still didn't have any response from the staff.

frosticek

  • Hero Member
  • *****
  • Posts: 3948
Re: BUG, price disable not working
« Reply #11 on: April 25, 2014, 11:00:16 am »
@searchweb
Did not find anything in theme.

searchweb

  • Jr. Member
  • **
  • Posts: 69
Re: BUG, price disable not working
« Reply #12 on: April 25, 2014, 01:46:10 pm »
@frosticek

thanks for your help. Same in here. Not sure why it's not working. Maybe wait help from official osclass teams.

searchweb

  • Jr. Member
  • **
  • Posts: 69
Re: BUG, price disable not working
« Reply #13 on: April 26, 2014, 03:59:00 am »
do anyone have any solution?

searchweb

  • Jr. Member
  • **
  • Posts: 69
Re: BUG, price disable not working
« Reply #14 on: April 26, 2014, 05:07:12 pm »
Looking for help.... seem another people also facing same problem for twitter theme.