Commit db3b2f0c by Matt Drayer

Merge pull request #11954 from edx/mattdrayer/theme-ecommerce-url

mattdrayer/theme-ecommerce-url: Theme support for ECOMMERCE_PUBLIC_URL_ROOT
parents a2faef24 000ad0a3
......@@ -16,6 +16,7 @@ from microsite_configuration import microsite
from request_cache.middleware import RequestCache
from student.models import UNENROLL_DONE
from openedx.core.djangoapps.commerce.utils import ecommerce_api_client, is_commerce_service_configured
from openedx.core.djangoapps.theming.helpers import get_value
log = logging.getLogger(__name__)
......@@ -196,7 +197,8 @@ def generate_refund_notification_body(student, refund_ids): # pylint: disable=i
"To process this request, please visit the link(s) below."
).format(username=student.username, email=student.email)
refund_urls = [urljoin(settings.ECOMMERCE_PUBLIC_URL_ROOT, '/dashboard/refunds/{}/'.format(refund_id))
ecommerce_url_root = get_value('ECOMMERCE_PUBLIC_URL_ROOT', settings.ECOMMERCE_PUBLIC_URL_ROOT)
refund_urls = [urljoin(ecommerce_url_root, '/dashboard/refunds/{}/'.format(refund_id))
for refund_id in refund_ids]
return '{msg}\n\n{urls}'.format(msg=msg, urls='\n'.join(refund_urls))
......
......@@ -55,7 +55,8 @@ class EcommerceService(object):
Example:
http://localhost:8002/basket/single_item/
"""
return urljoin(settings.ECOMMERCE_PUBLIC_URL_ROOT, self.config.single_course_checkout_page)
ecommerce_url_root = helpers.get_value('ECOMMERCE_PUBLIC_URL_ROOT', settings.ECOMMERCE_PUBLIC_URL_ROOT)
return urljoin(ecommerce_url_root, self.config.single_course_checkout_page)
def checkout_page_url(self, sku):
""" Construct the URL to the ecommerce checkout page and include a product.
......
......@@ -21,8 +21,9 @@
credit_msg_class = "credit-eligibility-msg"
credit_btn_class = "purchase-credit-btn"
credit_btn_label = _("Get Credit")
ecommerce_url_root = static.get_value('ECOMMERCE_PUBLIC_URL_ROOT', settings.ECOMMERCE_PUBLIC_URL_ROOT)
credit_btn_href = '{root}/credit/checkout/{course_id}/'.format(
root=settings.ECOMMERCE_PUBLIC_URL_ROOT,
root=ecommerce_url_root,
course_id=credit_status['course_key'])
if credit_status["purchased"]:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment