Advertisement:

Author Topic: help with payment pack description  (Read 2156 times)

Hambitz Classified

  • Newbie
  • *
  • Posts: 18
help with payment pack description
« on: March 31, 2014, 02:47:38 pm »
Hi forgive me if this has been asked before.... but where do I change the name of the premium ads payment packs.

currently they are set #1 #2 #3  and I want to give them a description.

thanks

Martin

design

  • Hero Member
  • *****
  • Posts: 2619
  • Osclass 3.5 MAC/PC w/ Modern Browsers
Re: help with payment pack description
« Reply #1 on: March 31, 2014, 10:58:41 pm »
payment plugin>index.php around line 144

Hambitz Classified

  • Newbie
  • *
  • Posts: 18
Re: help with payment pack description
« Reply #2 on: April 04, 2014, 01:41:18 pm »
Hi Design,

Sorry but I cant find it...or maybe I dont really understand what I am looking at... :-[

here is some of the code from  payments/index.php

   
Code: [Select]
     * Create a new menu option on users' dashboards
     */
    function payment_user_menu() {
        echo '<li class="opt_payment" ><a href="'.osc_route_url('payment-user-menu').'" >'.__("Listings payment status", "payment").'</a></li>' ;
        if((osc_get_preference('pack_price_1', 'payment')!='' && osc_get_preference('pack_price_1', 'payment')!='0') || (osc_get_preference('pack_price_2', 'payment')!='' && osc_get_preference('pack_price_2', 'payment')!='0') || (osc_get_preference('pack_price_3', 'payment')!='' && osc_get_preference('pack_price_3', 'payment')!='0')) {
            echo '<li class="opt_payment_pack" ><a href="'.osc_route_url('payment-user-pack').'" >'.__("Buy credit for payments", "payment").'</a></li>' ;
        }
    }


bsaically what I need is like in the image attached


Please can you advise me as I am not good with code  so would appreciate some help.

thanks

Martin

design

  • Hero Member
  • *****
  • Posts: 2619
  • Osclass 3.5 MAC/PC w/ Modern Browsers
Re: help with payment pack description
« Reply #3 on: April 04, 2014, 06:50:55 pm »
hmmm, now that we understand that my horrible advice didn't work (sorry 'bout that). I looked at mine, and the URL of the page, it "should be" in pack
so I go to >>payment>>user>>pack.php and see these lines

<h3><?php echo sprintf(__('Credit pack #%d', 'payment'), $pack_n); ?></h3>

which tells me the only part of that that can be changed is in green don't mess with the %d  you can change the # -

I did not make this plugin, I would have assumed it could be changed but I guess not as easily as i expected. I will ask for that option upon the next upgrade. feel free to ask for it also at github.

design

  • Hero Member
  • *****
  • Posts: 2619
  • Osclass 3.5 MAC/PC w/ Modern Browsers
Re: help with payment pack description
« Reply #4 on: April 04, 2014, 06:56:40 pm »
on another side you can work with it by moving it around in the code

ie.

<h3><?php echo sprintf(__('%d. is your new pack name', 'payment'), $pack_n); ?></h3>


will net -

1. is your new pack name
2. is your new pack name

it is a loop, so there isn't much else that I can think of?!  :-\

Hambitz Classified

  • Newbie
  • *
  • Posts: 18
Re: help with payment pack description
« Reply #5 on: April 05, 2014, 08:26:43 pm »
@Design

Many thanks for your advice.. however this afternoon I was playing with the code ( not really knowing what I was doing) lol

And I have made some progress see new image  also here are the changes I made to the code  in payments/user/pack.php

Code: [Select]
<h3><?php echo sprintf(__('Credit pack #%d''payment'), $pack_n); ?> one add</h3>
        <div><label><?php _e("Price""payment");?>:</label> <?php echo $pack." ".osc_get_preference('currency''payment'); ?></div>
        <?php if(osc_get_preference('paypal_enabled''payment')==1) {?>

Changed it to this
Code: [Select]
<h3><?php _e('Purchase'"payment");?> </label><?php echo $pack." ".osc_get_preference('payment'); ?> Premium adverts </H3>

        <div><label><?php _e("Price""payment");?>:</label> <?php echo $pack." ".osc_get_preference('currency''payment'); ?></div>
        <?php if(osc_get_preference('paypal_enabled''payment')==1) {?>


This uses the  pack price value set in admin for the number of adverts in the new description.

well I think that's what its doing ..... :-\   anyway it is working in essence to what I wanted but  is there any way to only display the number  as single digit  like  1,2,10   and not 1.00, 2.00,10,00...   see image what for what I   mean.

sorry if this is a poor way of doing it but like I said Im not a coder... but find out by trial and error

osCanyon

  • Hero Member
  • *****
  • Posts: 701
  • osCanyon, the class of Osclass
Re: help with payment pack description
« Reply #6 on: April 06, 2014, 12:49:12 am »
check in admin under Settings>Languages>YOUR LANGUAGE , isnt there a setting for decimal places?


Quote
well I think that's what its doing ..... :-\   anyway it is working in essence to what I wanted but  is there any way to only display the number  as single digit  like  1,2,10   and not 1.00, 2.00,10,00...   see image what for what I   mean.

Hambitz Classified

  • Newbie
  • *
  • Posts: 18
Re: help with payment pack description
« Reply #7 on: April 06, 2014, 03:28:11 pm »
@Digital Concepts.

Yes I think so  but this would change all number decimal places
  I don't want all the numbers changed just in this particular field so that the number of credits is displayed as single digits.

Maybe we have to create a different field ..as i was using the pack price number to show how many ads were purchased.

Like I say I don't know really what all this code means but willing to have a dabble if given some pointers in the right direction.

Not sure how to do this

Any suggestions  from anybody would be most appreciated

Thanks   Martin