Question Shop question for item config

Status
Not open for further replies.

CTS

Customer
Using Shop and testing the Create Forum item.

I have it configured properly and am testing it out.

My question is, when the user has purchased the Create Forum item in the store, and proceeds to the item config settings, it will show three sections for the user, Title, Desc, and parent forum.

I wish to remove the config choice from the config popup that asks for the parent forum. I will only be allowing created forums under one forum.

I dont wish the members to have that parent forum choice and have it always to default to the designated forum set by admin.

I did try to edit the template for that, and can remove the parent forum line, but it breaks the functionality of that item config.

I hope i just didnt miss a setting, but any help would be great.
 
Since I cant completely figure this out, I am looking at the templates again.

dbtech_shop_user_config_createforum


Code:
<div class="block-body">
    <xf:textboxrow name="code[title]" value="{$purchase.configuration.title}" required="true"
                   label="{{ phrase('title') }}"
                   hint="{{ phrase('required') }}" />
    <xf:selectrow name="code[parentid]" value="{$purchase.configuration.parentid}">
        <xf:foreach loop="$nodeTree.getFlattened(0)" value="$treeEntry">
            <xf:option value="{$treeEntry.record.node_id}" disabled="{{ ($treeEntry.record.node_type_id != 'Forum' || in_array($treeEntry.record.node_id, $item.code.excludedforums) || $treeEntry.record.node_id == $purchase.configuration.forumid) ? 'disabled' : '' }}"></xf:option>
        </xf:foreach>
    </xf:selectrow>
</div>

As you can see I have stripped out the description field and stripped out the parent forum text.

Just to accomplish my goal, how can I strip out the "xfselectrow" in the template to remove the field input box, and instead dedicate the parent forum always to one forum ID without any user selection available.



Thanks in advance
 
Edit the item configuration -> scroll down to "Item type options" and mark every forum except for the one you want to allow as parent forum as "excluded".

Removing the selectrow does not work, as users can simply edit the source HTML to change the parentid to anything they want. Using the item config is the only secure way of doing this.
 
  • Like
Reactions: CTS
Thank you.

Is there a way I can "hide" the parent forum selector without altering the functionality?

Yeah, I found out I can break it that way. But appreciate the information. I will have to adjust my goals a bit but I think I can get this right.
 
You could replace the block you posted with <xf:hiddenval name="code[parentid]" value="x" />
 
You could replace the block you posted with <xf:hiddenval name="code[parentid]" value="x" />

You mean to replace the ..
Code:
    <xf:selectrow name="code[parentid]" value="{$purchase.configuration.parentid}">
        <xf:foreach loop="$nodeTree.getFlattened(0)" value="$treeEntry">
            <xf:option value="{$treeEntry.record.node_id}" disabled="{{ ($treeEntry.record.node_type_id != 'Forum' || in_array($treeEntry.record.node_id, $item.code.excludedforums) || $treeEntry.record.node_id == $purchase.configuration.forumid) ? 'disabled' : '' }}"></xf:option>
        </xf:foreach>
    </xf:selectrow>

with...
Code:
<xf:hiddenval name="code[parentid]" value="x" />

Just not completely sure of the location you want that line inserted.
 
Thank you.

I did not replace the whole block and left the entry field for forum name to be entered. But tjhat snippet seems to have done the trick.

Removing the selectrow does not work, as users can simply edit the source HTML to change the parentid to anything they want. Using the item config is the only secure way of doing this.

That snippet, it does not expose any vulnerability, as suggested?
 
Hello @CTS,

We hope your ticket regarding DragonByte Shop has been addressed to your satisfaction. This ticket has now been scheduled to be closed.

If your ticket has not been resolved, you can reply to this thread at any point in the next 7 days in order to reopen the ticket, afterwards this thread will be closed.

Please do not reply to this thread if your ticket has been resolved.

Thank you.


- DragonByte Technologies, Ltd.
 
Hello @CTS,

As we have not heard back from you, your ticket regarding DragonByte Shop has now been closed.

If your ticket has not been resolved, please feel free to start a new support ticket and link back to this ticket.

If you have time, please leave a review on XenForo.com's Resource Manager.

Thank you.


- DragonByte Technologies, Ltd.
 
Status
Not open for further replies.

DragonByte Shop

XenForo 1.5.3+ XenForo 2.0.x XenForo 2.1.x XenForo 2.2.x XenForo 2.3.x
Seller
DragonByte Technologies
Release date
Last update
Total downloads
3,478
Customer rating
5.00 star(s) 3 ratings
Back
Top