Paypal & custom field

  • Posts: 259
  • Thank you received: 10
13 years 6 months ago #18470

Hey fellas,

Question 1:

I succesfully added a custom field to the article layout. Currently it shows up on every article. I was wondering if it is possible to have a custom field added only to selected articles, or define if it should be added when creating an article ?

Question 2:

As you probably know paypal charges for each transaction, i was wondering if there is a way to add a certain amount (paypal ratio+fixed amount) so that it adds it to the final article price, resulting in the extra cost added covering the charge and the final received amount is the actual total product price and also make it clear that there is an extra cost when using the paypal payment option

Please Log in or Create an account to join the conversation.

  • Posts: 83007
  • Thank you received: 13400
  • MODERATOR
13 years 6 months ago #18472

Hi,

1. There is no option for that for now but you can easily do it. Create a custom field of the table product so that you can select whether a product should have the custom item fields displayed or not (values yes and no). Then, edit the file show of the view product via the menu Display->Views and change the line:
if(!empty($this->itemFields)){
to:
if(!empty($this->itemFields) && $this->element->custom_field_column_name=='yes'){

2. There is not yet an option for that. And it wouldn't be easy to add for you.

Please Log in or Create an account to join the conversation.

  • Posts: 259
  • Thank you received: 10
13 years 6 months ago #18474

Ok, custom field created for "product". However no option yet to define if a product should have it or not thats where your code change comes in ? I went to views but there's a ton of views. Don't know wich one(s) to edit.

Please Log in or Create an account to join the conversation.

  • Posts: 83007
  • Thank you received: 13400
  • MODERATOR
13 years 6 months ago #18476

The field should be displayed when you edit a product provided that you defined your custom fields properly. Please do a screenshot of its options.

I told you which view to edit: the file show of the view product

Please Log in or Create an account to join the conversation.

  • Posts: 259
  • Thank you received: 10
13 years 6 months ago #18480

Ok view edited, but for some reason i can't get the custom field to show up at all :s anymore on any article

Please Log in or Create an account to join the conversation.

  • Posts: 83007
  • Thank you received: 13400
  • MODERATOR
13 years 6 months ago #18482

the custom field shoudl be of the type single dropdown or radio button with two values: yes and no...

Please Log in or Create an account to join the conversation.

  • Posts: 259
  • Thank you received: 10
13 years 6 months ago #18483

Don't think i make myself clear. The client must be able to enter a some text in the mandatory field upon placing the order of the product. Reason is that the entered text will be the title of the delivered product. I want to be able to define which products i want that custom field to appear on. Not all them will.

Please Log in or Create an account to join the conversation.

  • Posts: 83007
  • Thank you received: 13400
  • MODERATOR
13 years 6 months ago #18498

I understand that. But you're talking about the custom field of the table item. I'm talking (and your screenshot is) about the custom field of the table product. The later is for defining which products have that input box and the former is to handle that input box.

Please Log in or Create an account to join the conversation.

  • Posts: 259
  • Thank you received: 10
13 years 6 months ago #18510

The screenshot is like that because you said to create one in post 18474. Since i'm new to this could you say wich custom fields i need to create in which colums and what to modify. Just for the sake of clarity ill post it again. I need to be able to define which articles have the custom text field (not all of them will), but if it is visible, text input will be mandatory.

Please Log in or Create an account to join the conversation.

  • Posts: 83007
  • Thank you received: 13400
  • MODERATOR
13 years 6 months ago #18511

You need TWO custom fields.
one of the table product and of the type radio with two values, yes and no. So that you can select if the product needs the custom item field or not.
one of the table item and of the type text. So that you can display the input box on the product page.

Please Log in or Create an account to join the conversation.

  • Posts: 259
  • Thank you received: 10
13 years 6 months ago #18516

i'll post some ss's. Currently i have as followed (note GUI is in dutch)s
visible radio button on backend (mandatory to select if custom text field is needed)
custom field configured to have mandatory text input. However when radio is set to yes, field doesnt appear
item view has been modified with your code change

if(!$this->params->get('catalogue') && ($this->config->get('display_add_to_cart_for_free_products') || !empty($this->element->prices))){
       if(!empty($this->itemFields) && $this->element->custom_field_column_name=='yes'){


Please Log in or Create an account to join the conversation.

  • Posts: 83007
  • Thank you received: 13400
  • MODERATOR
13 years 6 months ago #18528

Your custom product field's column name is "domein". So you should replace custom_field_column_name by domein in the code modification.

Please Log in or Create an account to join the conversation.

  • Posts: 259
  • Thank you received: 10
13 years 6 months ago #18530

still doesnt work, tried also tried domeinnaam & domein: none of em show the text box. If click to have the "product" field 'domein' to show up on the front end then all it sais is "Ja" (dutch for yes). But thats not what i want, i want the text box

also tiny OT: what is "back end list" for ?

Last edit: 13 years 6 months ago by Ch3vr0n.

Please Log in or Create an account to join the conversation.

  • Posts: 83007
  • Thank you received: 13400
  • MODERATOR
13 years 6 months ago #18531

Could you give a link to your product page ?

Please Log in or Create an account to join the conversation.

  • Posts: 259
  • Thank you received: 10
13 years 6 months ago #18532

can't do that without setting the site to live, and it isnt ready yet. I can do a test account for ya. But can't find a way to pm you the details

Please Log in or Create an account to join the conversation.

  • Posts: 83007
  • Thank you received: 13400
  • MODERATOR
13 years 6 months ago #18533

You can use our contact form: www.hikashop.com/en/support/contact-us.html
If you give us access to the back end, we'll check your settings.

Please Log in or Create an account to join the conversation.

  • Posts: 259
  • Thank you received: 10
13 years 6 months ago #18534

done: title is my username & optional custom field. Template used is hs_hoster

Last edit: 13 years 6 months ago by Ch3vr0n.

Please Log in or Create an account to join the conversation.

  • Posts: 83007
  • Thank you received: 13400
  • MODERATOR
13 years 6 months ago #18535

The problem is that you didn't replace the custom_field_column_name by the name of your custom field and you used the value Ja instead of yes in the custom field.
The code needs to correspond to the valeus in the custom field... So it should be:
if(!empty($this->itemFields) && $this->element->domein=='Ja'){

I've modified it on your view and it's working.

Please Log in or Create an account to join the conversation.

  • Posts: 259
  • Thank you received: 10
13 years 6 months ago #18536

omg, can't believe i overlooked that lol. i thought i was supposed to replace that 'Ja' lol. and the obvious clue was custom_field_column_name.
Also a few more things:

* how come it has to be 'domein' and not 'domeinnaam'. How does it work when the 2 field column names are different. I tried it at first with 2 identical names but it wouldn't save. There has to be some kind of link between the 2 fields that tells joomla that the radio button is specifically for that text field only. What if i created a second one. I'm trying to understand the mechanics about that in the event i want to add a 2nd text box i know what the communal link has to be

* where do i go to resize the template things inside the categories listing & on the final article display. Im mainly talking about that big white area

* is it possible to place restrictions on that newly created field. I need the users to be able to enter any alphabetical text but it has to end with eg: .be on other item's ill need that field to accept any alphabetical text but it has to end with anything BUT eg: .be
Is that possible ?

Sorry about that but thanks for fixing it :D


Final thing: whats that back end list for. Any special purpose ?

Last edit: 13 years 6 months ago by Ch3vr0n.

Please Log in or Create an account to join the conversation.

  • Posts: 259
  • Thank you received: 10
13 years 6 months ago #19191

Anything ?

another reason i'm asking is that if i want to add another custom field i'd need to know how and what the common link should be

Please Log in or Create an account to join the conversation.

Time to create page: 0.088 seconds
Powered by Kunena Forum