How to hide HTML strong text using catalog client script???

mallikarjunared
Tera Contributor

Hi All,

I am unable to hide HTML text using catalog client script.   I want only Order Now button in the form.

Order.JPG

I wrote catalog client script and able to hide everything, but not Order this Item text which doesn't have Id in view source(HTML).

function onLoad()

{

  sc_delivery_time_label_cell.hide();

  sc_delivery_time_cell.hide();

  sc_cart_item_list.hide();

  price_subtotal_span.hide();

  price_subtotal_label_span.hide();

  price_label_span.hide();

  price_span.hide();

  quantity_label_span.hide();

  quantity.hide();

  oi_add_to_cart_button.hide();

}

Someone Plz let me know how to hide this Order this Item text in the form using catalog client script???

1 ACCEPTED SOLUTION

Hi Mallikarjuna,



A couple of observations:



a) you may want to remove the .hide() lines since these could be causing errors and so then stopping the execution of the script


b) try adding the script in an onChange catalog client script. I tried it in Fuji and it works (it removes the Order This Item label)



function onChange(control, oldValue, newValue, isLoading) {


    gel('qty').firstElementChild.childNodes[0].style.display = 'none';




    //Type appropriate comment here, and begin script below


   


}



Thanks,


Berny


View solution in original post

12 REPLIES 12

its working fine now


Hi Mallikarjuna Potha,



Even I am implementing the same. I want to hide the 'Order this item' label. I   am able to do with the scriptgel('qty').firstElementChild.childNodes[0].style.display = 'none';.



But it ll be for a particular catalog item if i write a onLoad script on catalog item. How to make it work for all the catalog item ??


Please help on this.


HI All,



The code, "gel('qty').firstElementChild.childNodes[0].style.display = 'none';." works fine. But I dont understand this line of code, Can anybody help me understand about this?


Hi Ganapati, sure.



I'll explain how i wrote this code within a couple of minutes and then everything else will make sense...



To write this particular line of code i just went an did an Inspect Element browser function over the element I will like to modify. The browser will then show me the internal structure of that element and the html that surrounds it. I did went ahead and identified the first identifiable element (element with an ID on it) from which i could start to crawl up to the point where I can reach the label. Once I have reach the given label element, i can then modify it's display property to none.



A couple of comments about this approach:


a) it was a very quick example intended to demonstrate how it can be done.


b) it's not the most elegant solution and very sensitive to be broken in a future SNOW release since it's depending on internal elements of the SNOW page that could change on any release without notice.



I hope this helps!



Thanks,


Berny


hi  


onChange script is not working for me :can you give clear idea about this????