0

Hi Programatically i want to change from base url https into http

<a href="<?php echo $this->getDeleteUrl() ?>" title="<?php echo $this->__('Remove This Item') ?>" onclick="return confirm('<?php echo $this->__('Are you sure you would like to remove this item from the shopping cart?') ?>');" class="btn-remove"><?php echo $this->__('Remove This Item') ?></a>

// echo https://domain.com/checkout/cart/delete/id/5252/uenc/aHR0cDovL3RvdGFsdG95cy5jb20v/'

i want to change in

 <a href="<?php echo $this->getDeleteUrl() ?>" title="<?php echo $this->__('Remove This Item') ?>" onclick="return confirm('<?php echo $this->__('Are you sure you would like to remove this item from the shopping cart?') ?>');" class="btn-remove"><?php echo $this->__('Remove This Item') ?></a>

// echo http://domain.com/checkout/cart/delete/id/5252/uenc/aHR0cDovL3RvdGFsdG95cy5jb20v/'

1 Answer 1

1

I think you mean you just want to convert the anchor url from https to http?

Then you could do

<?php echo str_replace( 'https://', 'http://',$this->getDeleteUrl()) ?>

Changing the base url in the database programatically can also be done but it is probably a very bad idea.

2
  • How to check url have http:// or https because in my website have http:// & https:// also
    – Magento 2
    Commented Sep 24, 2015 at 17:38
  • Can you explain exactly what you need, why do you want to check if the url is http or https first?
    – paj
    Commented Sep 25, 2015 at 7:01

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.