ninetydegrees: Photo: bingo chips (bingo)
ninetydegrees (90d)☕ ([personal profile] ninetydegrees) wrote in [site community profile] dw_dev_training2010-04-18 02:30 pm

QFaN: how do you display the Shop menu?

"Shop" isn't displayed on my Dreamhack. It seems to me it used to so, obviously, something's changed. Would someone tell me how to turn it on, please?
pauamma: Cartooney crab wearing hot pink and acid green facemask holding drink with straw (Default)

Assuming you mean in the navbar menus...

[personal profile] pauamma 2010-04-18 02:06 pm (UTC)(link)
From cgi-bin/DW/Logic/MenuNav.pm (DW::Logic::MenuNav):
            name => 'shop',
            items => [
                {
                    url => "$LJ::SITEROOT/shop",
                    text => "menunav.shop.paidtime",
                    display => LJ::is_enabled( 'payments' ) ? 1 : 0,
                },
                        {
                    url => "$LJ::SITEROOT/shop/history",
                    text => "menunav.shop.history",
                    display => LJ::is_enabled( 'payments' ) && $loggedin ? 1 : 0,
                        },
                        {
                    url => "$LJ::SITEROOT/shop/gifts",
                    text => "menunav.shop.gifts",
                    display => LJ::is_enabled( 'payments' ) && $loggedin ? 1 : 0,
                },
                {
                    url => "$LJ::SITEROOT/shop/randomgift",
                    text => "menunav.shop.sponsor",
                    display => LJ::is_enabled( 'payments' ) ? 1 : 0,
                },
            ],


LJ::is_enabled is defined (in cgi-bin/ljlib.pl) as:
sub conf_test {
    my ($conf, @args) = @_;
    return 0 unless $conf;
    return $conf->(@args) if ref $conf eq "CODE";
    return $conf;
}

sub is_enabled {
    my $conf = shift;
    if ( $conf eq 'payments' ) {
        my $remote = LJ::get_remote();
        return 1 if $remote && $remote->can_beta_payments;
    }
    return ! LJ::conf_test( $LJ::DISABLED{$conf}, @_ );
}


What do you have in $LJ::DISABLED{payments}? (Should be set in ~dw/etc/config.pl)