Country Detection for URL redirect (Shopping Cart)

I want have two domain names
www.demo.com.au
www.demo.co.nz
If a viewer from New Zealand (NZ) visits the Australian site (.com.au), I want the website to detect that they are from New Zealand and redirect them to the NZ domain. 
I found this Javascript code on the Business Catalyst KB, however it seems to loop over and over again, even though there are breaks included in the script.
<script language="javascript">
var country = '{module_visitorcountrycode}'; // e.g. var country = US;
switch (country) {
case 'US':
document.location = 'http://us.yourcompany.com';
break;
default:
document.location = 'http://www.yourcompany.com';
break;
</script>
I've read that I should use cookies but I'm not sure how to implement that with the above script.
Any help would be much appreciated. 
Kind Regards
Brendon

Thanks Liam.  Maybe something more along these lines then"?
<script language="javascript">
var country = '{module_visitorcountrycode}'; // e.g. var country = NZ;
var countryCookie = document.getcookie(countrycode);
if countryCookie == 'NZ';
switch (country) {
case 'NZ':
document.location = 'http://www.google.com';http://www.demosite.com.au'; // current page;
break;
default:
document.location = 'http://www.demosite.co.nz'; // page to be redirected to;
break;
</script>

Similar Messages

  • More than one Follow On documents for a single shopping cart

    Hi All,
    How can we determine if there will be more than one follow on document created for a single shopping cart.
    One reason could be if shopping cart items have different source of supply.
    What could be the other reasons. Also is there any way by which we can debug and find out the number of follow on documents created for a single shoppining cart.
    Thanking you all in advance.
    Thanks and Regards
    Manoj

    Hi  Manoj,
    <i>"Also is there any way by which we can debug and find out the number of follow on documents created for a single shoppining cart."</i>
    There's a FM to get all the follow on documents related to the SC and all the relations per item... use <b>BBP_PD_SC_GETDETAIL</b> and retrieve the <b>E_HEADER_REL</b> for the SC relations, and the <b>E_ITMLIM_REL</b> for each <b>item relations</b>.. there you will see:
    OBJECT_ID_A -> OBJECT_ID_B
    what it means is the relation between a SC and the PO, or the SC with a BID... you can identify the object types by taking a look in the 'BUS...'
    OBJTYPE_A -> OBJECTTYPE_B
    SC -> BUS2121
    PO-> BUS2201
    BID-> BUS2200
    etc...
    I hope this can help you to retrieve what you need....
    BR,
    Gerardo....
    PS: reward points please....

  • How to change position for items in shopping cart

    Hello,
    I am creating shopping cart using flat file. But i am not able to change the position for items i.e. both items contain position as 0000000001.
    Following are the item details of shopping cart which is created through portal. (from tcode BBP_PD)
    Items:
    Pos Type Quantity Unit Ordered_Prod Description Gross price
    0000000001 1 EA keyboard 100,00
    0000000002 1 EA CPU 1.000,00
    Following are the item details of shopping cart which is created using flat file & BAPI BBP_PD_SC_CREATE.(from tcode BBP_PD)
    Items:
    Pos Type Quantity Unit Ordered_Prod Description Gross price
    0000000001 1 EA MONITOR 1,00
    0000000001 1 EA MONITOR 1,00
    Position is not getting changed for item 2 & only first record is getting uploaded 2 times. My code is creating Shopping cart number .
    Please tell me how to change position of each item.
    Thanks & regards,
    Edited by: Ketkee Bhale on Sep 14, 2011 3:58 PM

    Moderator message - Cross post locked
    Rob

  • Table for PO and Shopping cart  combination in SRM

    Hi Guys,
    Can any one help me out with a table which gets updated with PO and Shopping numbers in SRM.?
    Regards
    Srujank

    Hi Srujan.
    The table CRMD_ORDERADM_H will store the document numbers. But it wont be storing both the shopping cart as well as PO number for a record.
    To find out the SC number from PO or vice versa use the following method:
    You can use pass the PO number in function module BBP_PD_PO_GETDETAIL.
    From here you will get the Shopping cart Item Guid in E_ITEM-SRC_GUID. You can again pass this guid in the table CRMD_ORDERADM_I and get the parent guid.
    Pass this parent guid in table CRMD_ORDERADM_H to get the shopping cart number. Its stored in the OBJECT_ID field.
    There is another way to find out the shopping cart number:
    Pass the PO number in FM BBP_PD_PO_GETDETAIL
    Check the E_HEADER_REL, when the value of the field OBJTYPE_A = BUS2121 then the field GUID_A will contain the header guid of the shopping cart.
    Use this guid to get the SC number from table CRMD_ORDERADM_H.
    Hope this helps.
    Thanks,
    Pradeep

  • PR is not creating in Backend ECC for Direct material Shopping carts

    Hello Experts,
    i have one issue, due to some reasons we deactivated 'Order as Direct Material' button on our SRM shoppingcart screen. But again due to the requirement we activated the 'Order as Direct Material' button. Now the issue is when we are creating a shopping cart by using order as direct material button no Purchase Requisition is creating in the backend ECC. we are in SRM 5.0. we already implemented BADI: BBP_CREATE_BE_RQ_NEW. we are able to create PR for the shopping carts which we order normally i.e for non-direct materials (with out using that order as direct material button).
    please guide me on this!!!
    thanks in advance!!!!
    regards
    CD Reddy

    Hello,
    You can use note 1173815 to debug if follow-on document determination is occurring in backend.
    Also, you will be able to check if any error happened during this process.
    Kind regards
    Ricardo

  • Email notifications for Rejection of shopping cart

    Hi Everybody,
    I would like to know if it is possible to generate an email notification to the employee if a manager rejects a shopping cart (partially or completely).
    if it is possible, please let me know how it can be done.
    Regards,
    Vidhya M

    Hi,
       Are you using any of the Standard  Workflow for SC approval?If so,this is a std feature in the std workflows.
       For more info,refer the foll link:
    http://help.sap.com/saphelp_srm40/helpdata/en/5a/af5f0285d011d2b42d006094b92d37/content.htm
    BR,
    Disha.
    Pls reward points for useful answers.

  • Need to delete / clear PO value for a deleted shopping cart item.

    Hi friends
    Please help me on below mentioned issue.
    I have a shopping cart with one deleted item, That deleted item shows a PO number under table BP_PDBEI field BE_OBJECT_ID in production server.
    User want that PO number to be delete or clear from that shopping cart deleted item.
    We are not authorize to delete or clear a entry from the SAP standard table itself.
    Is there any function module, I can use directly in production server which can delete / clear this PO number from table BP_PDBEI field BE_OBJECT_ID from shopping cart deleted item
    Please help urgently.
    Thanks a lot in advance.

    Hi
        check this FM
    ISM_PORDER_DELETE
    ISM_PORDERNEW_DELETE
    ISM_PORDERRET_DELETE
    Regards,
    Viquar Iqbal

  • Need to delete PO value for a deleted shopping cart item.

    Hi SRM experts
    Please help me on below mentioned issue.
    I have a shopping cart with one deleted item, That deleted item shows a PO number under table BP_PDBEI field BE_OBJECT_ID in production server.
    User want that PO number to be delete or clear from that shopping cart deleted item.
    We are not authorize to delete or clear a entry from the SAP standard table itself.
    Is there any function module, I can use directly in production server which can delete / clear this PO number from table BP_PDBEI field BE_OBJECT_ID from shopping cart deleted item
    Please help urgently.

    Hi Sharma,
    normally if this PO doesn't have further follow-on documents, should be able to be deleted. Once the PO is deleted, the SC will be updated and in the follow-on document history of the SC you will see an additional remark "follow-on document deleted".
    But I guess, this is not what you would like to do.
    Without manual database changes you won't be able to delete the connection between the SC and PO.
    If you somehow will get authority to the database changes, please don't forget to delete also the relations between PO and SC. You will find it in the tables SRRELROLES and BBP_PDBINREL.
    Regards,
    Peter

  • SRM alert for changes in shopping cart

    Hi,
    We have a requirement to create a shopping cart automatically upon receiving a trigger and the necessary purchase information from an external system and then send an update to the external system when the preferred vendor updates the price in the shopping cart or whenever there's a status update (approved, error, etc.).
    I wonder whether there's a way to set an alert that will automatically inform the external system that there's an update in the shopping cart.
    There's a BADi called BBP_ALERTING. Can this BADi be used to achieve our goal ? If not, how can we achieve this goal ?
    Thanks,
    Lara

    Hi. If you want to trigger the update yourself from a BADI when certain data is changed then BBP_DOC_CHANGE_BADI is called every time data is changed and contains the latest data.
    You can use it to check when certain fields are filled in then send the data to the external system.
    If you want to make sure that the data is only triggered once you could create custom fields to store a flag when you first send an update to make sure that you do not send it again. You can use the BBP_CUF_BADI to hide the custom fields from the user but you can still amend the data in them from BBP_DOC_CHANGE_BADI.
    This way when you first inform the external system that the vendor has been added you can store an X in a custom field. The code to send to the external system can check 'If vendor is not blank and custom field is blank then send to external system and update custom field to X'.
    Regards,
    Dave.

  • Override the Interpreter class for URL redirect

    We are running the C# version of the 5.0.2 portal.
    I need to modify the Interpreter such that I can create a mechanism to redirect requests from given URLs to real Plumtree URLs.  I need some guidance on the best way to deal with the the Interpreter.
    Example:
    I would create a collection of URLs and map them to community pages based on community page ID (or name based on a query for name to id), store this in a hashtable, in a varpack, etc.
    http://server/portal/awl.1  =  http://devportal/portal/server.pt?in_hi_userid=689&space=CommunityPage&parentid=0&cached=false&control=SetCommunity&PageID=0&CommunityID=202&parentname=Login#
    So the user could enter URL http://devportal/portal/awl.1 and be redirected to the second url.
    The only documentation I see on the Interpreter is (from the javadocs...)
    http://portal.plumtree.com/portal/server.pt/gateway/PTARGS_0_286963_12064_2758_0_43/http%3B/prodgadget03.plumtree.com/Gadgets/Department_Customer_Care/Support_Center/html-asp/apiportlets/libraries/plumtree/portalui/5.0.2/javadoc/portalui/com/plumtree/uiinfrastructure/activityspace/Interpreter.html#HandleRequest(com.plumtree.openfoundation.web.IXPRequest,%20com.plumtree.openfoundation.web.IXPResponse,%20com.plumtree.uiinfrastructure.web.ISessionManager,%20com.plumtree.uiinfrastructure.web.IApplication)
    When I examine the UI source I find HttpInterpreterBridge.cs and HttpInterpreter.cs, but they just instantiate a new Interpreter.  Would somebody provide some guidance on overriding the behavior of the Interpreter, especially those who can see the source code for the Interpreter class?  Perhaps somebody could send me the source to the Interpreter class?

    Dear All,
    We have a case that looks like this case, we need to make the redirection URLs returned to the user dependent on a query string in the URL, this is a very critical point with a very important customer, we need a reply from the plumtree stuff.
    Thank you,
    Dalia

  • Additional Approvers for a changed shopping cart.

    Good afternoon all, hope you are all well.
    I hope one of you guy and guls can help me. We currently have one approver set to be able to approve changed carts and PO's can you tell me where we can add an additional approver, so basically they would both get informed there is a cart or po to approve?
    I hope i have explained what i require, please feel free to ask me more questions if need be.
    Regards
    Steve

    Hi,
    There are 2 options.
    1. Using SAP Business Workflow functions.
    Define new Agent object in SWO1 and change the workflow container type of Agent_001.
    [Change standard approvers for Invoice WF WS10400017 - 1 step approval|Change standard approvers for Invoice WF WS10400017 - 1 step approval]
    2. Using BADI and N-step approval template.
    Inplement the BBP_WFL_APPROV_BADI.
    Regards,
    Masa

  • Need help setting up approval workflow step for PO and Shopping Cart

    Hello,
    We are on SRM 7.0 and setup BRF and process level config for automatic approvals of SCs and POs using task 40007988. We would now like to test approval based workflow (create work item to route to approver) using a process level step.
    1) Is there a standard task that can be used to enter in the process level step? Or should we create a new standard task? If a new task is required, what import/export parameters should be defined?
    2) How do we setup agent for this step? Are the entries u201CResp Resolveru201D and u201CResp Resolver Parameteru201D in process level config required? The BADI BD_WF_RESP_RESOLVER already has some SAP delivered implementations? Should I create a new implementation here?
    Thanks,
    Zack

    Hi,
    Welcome to new Process-Controlled Workflow implementation in SRM 70.
    You can find the task list in the transaction PFTC. Task Group 40000003.
    Please activate the BC Sets in transaction SCPR20. Find the BC Sets /sapsrm/*.
    Regards,
    Masa

  • Procure item for inventory in Shopping cart as  Order as Direct Material

    Hello Experts,
    When i procure a an item for inventory click u201COrder as Direct Materialu201D and then the system would not ask for an account assignment,
    1.) where i can do this setting
    2.) the actual problem am facing is "SC is created but PO goes to status Saved and when i see PO i can see  the error and this is  "Backend error : enter account assignment category".
    Please let me know on this....i hope this will also be a great learning for me towards a journey of become masters in SRM like all of you
    Smriti

    yes. for order as direct account assignment folder disappear.
    Ordering a direct material means ordering a product that will be received into stock.
    You have to press the Order as Direct Material button in the item detail view.
    Selecting Order as Direct Material replaces the goods recipient with the plant you
    are ordering for and removes the Account Assignment information. The plants and
    storage locations are defined in the organizational structure in the extended attributes
    Locations and Storage Locations. After ordering the material as a direct material, you
    cannot change back to indirect; so, in case of a mistake, you have to delete this item.
    If you have a valid and definite source of supply, such as a contract, this will be used.
    Items without a source of supply will have to be completed by the purchaser in
    sourcing transaction or in the worklist of incomplete purchase orders. The complete
    purchase order will then be replicated to the back end system. Changes to the purchase
    order is only possible in Enterprise Buyer, which is the leading system for this process.
    Any changes made in Enterprise Buyer are transferred to the back end.

  • Cost center not committed on shopping cart,  for account assign cat "Asset"

    Hello,
    We are implementing extended classic scenario in SRM 5.0 with ECC 6.0 backend.
    While creating a shopping cart in SRM, in the cost assignment tab when we select an account assignment category as “Asset", and then try to enter a value in the cost center in the basic details of cost assignment, it is not getting committed to shopping cart screen. The cost center field value is lost when we move to the next screen for ordering the shopping cart. For the asset related purchases, we are using main account assignment category as "asset" and it also requires cost center, because while the asset master record is being created in R/3 for these items,it requires the cost center. We also using internal order. So for the account assignment category "Asset", the other account assignment fields that can be entered are cost center, internal order and one custom field called "project code".
    We have created this user-defined field in the cost assignment tab in the shopping cart, purchase order and confirmation documents in SRM in accordance with the OSS note 672960. We have implemented BBP_CUF_BADI_2 & BBP_DOC_CHANGE_BADI, BBP_DOC_CHECK_BADI for the shopping cart object.
    Can someone please help me with this issue?
    Thanks,
    Krupa

    thanks Ramakrishna and Yann for your prompt reply..
    Ramakrisha,
      I know that for assets, SC requires asset number and G/L is automatically derived from the corresponding asset class from the backend. In our case, we are putting dummy asset number in shopping cart and this asset number exists in R/3. But we are not generating asset creation during shopping cart creation but we are doing it during the PO creation in doc change badi. During this asset generation you also need cost center on the asset record. So we have added cost center field for Asset account assignment category and I can see it in the details of account assignment. But when I enter this cost center on shopping cart, it doesnot get committed, it disappears when I order the shopping cart.
    Does anybody have any clue why this might be happening?
    Thanks,
    Krupa

  • Function Module's for Shopping Cart.

    Hi all,
    I want to know which is the function module to know item details and for status of shopping cart in BBP_PD. Also, can anybody please guide me how to use those in simple reports.
    Thanks in advance.
    Regards!
    Rahul

    hi,
       You can see the foll FM's:
    BBP_PD_SC_GETDETAIL
    BBP_PD_SC_GETITEMLIST
    BBP_PD_SC_ITEM_GETDETAIL
    BBP_PD_SC_ITEM_STATUS_CHECK
    BBP_PD_SC_GETLIST
    BBP_PD_SC_CHECK
      In addition, you can use the tables
    CRMD_ORDERADM_H,
    CRMD_ORDERADM_I,
    BBP_PDBEI
    to get the SC details.
    BR,
    Disha.
    Pls reward points for useful answers.

Maybe you are looking for

  • IMac 8,1 Random Freezing

    Hey guys, My computer has started randomly freezing in the past few months. As I'd migrated from a MacBook with a lot of crap on it, I tried a reformat, but to no avail. I also thought it might be my RAM as I ran Memtest and it came up with errors, s

  • My iPod touch needs to be activated and the screen is locked.

    My iPod touch screen wasn't working so I turned it off. After I turn it on again it says "activation requiered". I went to the iTunes in my computer and try to activate it but then it says It was locked and I need it to enter the pass code, even thou

  • Singleton serialization and weblogic - help!

    hi everyone, I'm trying to serialize a singleton cache object we're using for our (intranet) website running on weblogic 6.1. I've made sure the singleton class implements serializable, and i've also put the following method in the singleton class (C

  • Pathfinder not expanding in CS5

    Hi, Does anyone know why the expand function isn't  working, i've heard that adobe has done away with it, but i really need  to expand some text so i can have a gradient run through it all, and not  just each character. I've just upgraded from CS3 an

  • Font could not be found

    font "PZANLF+MetaHeadlinePro-Bold" could not be found how could i install it under adobe acrobat 9 standard this problem seems to be only since a few days thanks a lot