Items add in the costs of their item separately from the magical properties.
If we look at the rules for creating magic items, we see:
Magic supplies for items are always half of the base price in gp. For many items, the market price equals the base price. Armor, shields, weapons, and items with value independent of their magically enhanced properties add their item cost to the market price. The item cost does not influence the base price (which determines the cost of magic supplies), but it does increase the final market price.
So when making +1 flaming longbow it would cost \$4375\$ gp (\$8000\$ gp [base magic price] x \$0.5\$ [crafting] + \$75\$ gp [longbow] + \$300\$ gp [masterwork]), and any price reductions for making magic items would only apply to the magic portion of its cost. E.G. Spark of Creation would further reduce it's cost by \$200\$ gp = \$8000\$ gp x \$0.5\$ x \$0.05.\$
Some additional details:
In addition, some items cast or replicate spells with costly material components. For these items, the market price equals the base price plus an extra price for the spell component costs. The cost to create these items is the magic supplies cost plus the costs for the components. Descriptions of these items include an entry that gives the total cost of creating the item.
This means that when you craft a scroll of Wish, it costs \$1,912.5\$ gp (25 gp x 9 (spell level) x 17 (caster level) x 0.5 (crafting)) for the magic supplies for the scroll, and \$25,000\$ gp for the spell component cost of Wish for a grand total of \$26,912.5\$ gp.
If you wanted to buy a scroll of Wish (or other spell completion item of wish) that's only usable by wizards (a \$30\$% reduction), it would instead cost \$1,338.75\$ gp (\$25\$ gp x \$9\$ (spell level) x \$17\$ (caster level) x \$0.5\$ (crafting) x \$0.7\$ (class restricted)) for the magic supplies for the scroll, and \$25,000\$ gp for the spell component cost of Wish for a grand total of \$26,338.75\$ gp. Note that this is not the \$18,838.75\$ gp that it would cost if you just reduced the whole price by \$30\$% (a savings of \$8,073.75\$ gp).