0

I want to get custom product attribute ('deliverytime') values for checkout config in jquery

Here is the code for getting default product attributes jquery

date-block.js

 function updateDeliveryDateAndTime() {
                if($('#delivery_date').length && window.checkoutConfig && window.checkoutConfig.quoteItemData) {

                    console.log(checkoutConfig.quoteItemData);
                    //read checkoutconfig
                    var quoteData = checkoutConfig.quoteItemData,
                        quote_length = quoteData.length,
                      prep_times = [],
                      creation_dates = [],
                      cake_names = [],
                      item_ids = [];
                    console.log(quoteData[0].deliverytime); // **this shows undefined** 

in checkoutconfig.quoteItemdata has no custom attributes are showing

checked in console

could anyone help me to resolve the problem..

0

Use your same product object $obj->getDatetime(); get is appended to your fields name (you see in admin on inspecting the element)

So if you fields is product['datetimevalue'] . Then syntac would be getDatetimevalue();

Assign this value to one of the div element. In jquery just pull value and show.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.