0

we are using this code for updating the price .

once we click on "update" button its displaying as like in image .

what we need is once we click on "update" buttton, than " Update" and "cancel" button should hide.

for "cancel" button, its working fine. once we click on "cancel" buttton, than " Update" and "cancel" button is hidingenter image description here.

<span class="label pro_status">
    <?php //echo $products->getPrice(); ?>

        <span id="valueprice_<?php echo $products->getId(); ?>"><?php echo $products->getPrice(); ?></span>
    <input type = "text" id = "price_<?php echo $products->getId(); ?>" onkeydown="validateNumbers(event)" "name = "price" value = "<?php echo $products->getPrice(); ?>" style = "display:none"/>


    <!-- aki 2 -->
    <span class="label wk_action" id="edit_link_<?php echo $products->getId(); ?>">
<img onclick="showFieldPrice('<?php echo $products->getId(); ?>'); return false;" 
src="<?php echo $this->getSkinUrl('marketplace/images/icon-edit.png'); ?>"/>
        </span>  
    <p id="updatedprice_<?php echo $products->getId(); ?>" style = "display:none;color:red;">Updated</p><br/>
    <button id="price_update_button_<?php echo $products->getId(); ?>" class="button wk_mp_btn1" onclick="updateFieldPrice('<?php echo $products->getId(); ?>'); return false;" style="display:none" >
                <span><span style="font-size:12px;"><?php echo $helper->__('Update') ?></span></span>
                                                        </button>
    <button id="price_reset_button_<?php echo $products->getId(); ?>" type="reset" class="cancel" onclick="hideResetPrice('<?php echo $products->getId(); ?>'); return false;" style="display:none" >
<span><span><?php echo $helper->__('Cancel') ?></span></span>
                                                        </button>                                                       
                                                    </span>

script

<script>
function updateFieldPrice(product_id)
        {
            var priceId = '#price_'+ product_id;
            var valueId = '#valueprice_'+ product_id;
            var updatedqty = '#updatedprice_'+ product_id;


            var editLink = "#price_edit_link_"+ product_id;
            var updateButton = "#price_update_button_"+ product_id;
            var resetButton = "#price_reset_button"+ product_id;
            var url ='<?php echo Mage::getUrl('marketplace/marketplaceaccount/updateFieldPrice/')?>';

            $wk_jq(priceId).toggle()

            $wk_jq(editLink).hide();
            $wk_jq(updateButton).show();
            $wk_jq(resetButton).show();

            $price = $wk_jq(priceId).val();
            jQuery(valueId).html($price);
            hideReset(product_id);


    </script>
7
  • 1
    $wk_jq(updateButton).show(); change this to $wk_jq(updateButton).hide(); Commented Nov 9, 2015 at 12:08
  • update button is hiding, but cancel button is visible Commented Nov 9, 2015 at 12:20
  • 1
    $wk_jq(resetButton).show(); to $wk_jq(resetButton).hide(); Commented Nov 9, 2015 at 12:21
  • 1
    var resetButton = "#price_reset_button"+ product_id; change this to var resetButton = "#price_reset_button_"+ product_id; Commented Nov 9, 2015 at 12:26
  • 1
    post ur comment as answer..... Commented Nov 9, 2015 at 12:29

1 Answer 1

1

make these three changes..

$wk_jq(updateButton).show(); change this to $wk_jq(updateButton).hide();



var resetButton = "#price_reset_button"+ product_id; change this to var resetButton = "#price_reset_button_"+ product_id;



$wk_jq(resetButton).show(); to $wk_jq(resetButton).hide(); 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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